I have a VB application in MS Access 2003 which creates a PDF report and then attaches it to an email We now need to password protect the PDFs and the password will be customised for each document created. Here is the heart of the VB code that I use for creating the document: (apologies if code is supposed to be enclosed in tags but I can't see any help about posting code)
The code I'm using in VB is credited as follows:
'Author : Ken Puls ( www.excelguru.ca)
'Macro Purpose: Print to PDF file using PDFCreator
' (Download from http://sourceforge.net/projects/pdfcreator/ )
' Designed for early bind, set reference to PDFCreator
'Start PDF Creator
Set pdfjob = New PDFCreator.clsPDFCreator
With pdfjob
If .cStart("/NoProcessingAtStartup") = False Then
MsgBox "Can't initialize PDFCreator.", vbCritical + _
vbOKOnly, "PrtPDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPDFPath
.cOption("AutosaveFilename") = sPDFName
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With
So I think there may be two options.
One is that within the VB code I just pop up a box to get the user to type in the required password. What would be the parameter I need e.g. would it be something like .cOption("AutosavePassword") = enteredPasswordString
Or is there a switch that I can put in that would pop up something from the PDFCreator interface itself to prompt the user for a password.
Many thanks.