I have an old version of PDF Converter (2.1). Always works fine, but I want to put a password on the document.
I found another Topic in this message board and it said to do the following.
pdf.Permissions = -64 + 4 '+ 16 + 32
pdf.FileNameOptionsEx = 1 + 2 + 256
pdf.OwnerPassword = "password"
pdf.UserPassword = "clientpassword"
pdf.SetDefaultConfig
I added this to my code. The code doesn't produce an error and the file is created.
Yet, it doesn't ask me for a password when opening.
Here's is a code snippet.
'****************************************************
pdf.DriverInit strPDF_PRINTER_NAME ' strPDFPrinterName is declared as the name of the existing printer
'this is to be called after PDFDriverInit / DriverInit for Developer version 2.1
pdf.EnablePrinter LicensedTo, ActivationCode
'Set this printer as default
pdf.SetDefaultPrinter
' set output PDF file name
pdf.DefaultFileName = "C:\Test.pdf"
'***NEW CODE FOR PASSWORD PROTECTION
pdf.Permissions = -64 + 4 '+ 16 + 32
pdf.FileNameOptionsEx = 1 + 2 + 256
pdf.OwnerPassword = "password"
pdf.UserPassword = "clientpassword"
pdf.SetDefaultConfig
'***
pdf.FileNameOptionsEx = NoPrompt + UseFileName
' 'Enable the printer before each printout for the Developer version 2.1
pdf.EnablePrinter LicensedTo, ActivationCode
' print first report
DoCmd.OpenReport strReportname, acViewNormal
pdf.RestoreDefaultPrinter
NeedToRestoreDefault = False
' Reset options to zero
pdf.FileNameOptions = 0
Set Password In VBA
Re: Set Password In VBA
Hello
Your code snippet is correct for encrypting a document. You can find more information on encyption at the following online documentation:
http://amyuni.com/WebHelp/Merged_CDI_Do ... ssions.htm
In versions before v3.0 the PDF Converter developer license was split into a standard license or a professional license.
To use the advanced functions like encryption in earlier versions (like v2.1), you required the professional license. I suspect that you have that standard license which does not have the encryption option enabled.
Hope that helps
Your code snippet is correct for encrypting a document. You can find more information on encyption at the following online documentation:
http://amyuni.com/WebHelp/Merged_CDI_Do ... ssions.htm
In versions before v3.0 the PDF Converter developer license was split into a standard license or a professional license.
To use the advanced functions like encryption in earlier versions (like v2.1), you required the professional license. I suspect that you have that standard license which does not have the encryption option enabled.
Hope that helps
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
Re: Set Password In VBA
Sorry it took so long to respond. I had to change my eamil and it took a while before the forum manager got back to me.
Yes, I do have a full professional version of this:
"Developer License of the Amyuni PDF Converter Professional for Windows"
So should I be having this problem?
John
Yes, I do have a full professional version of this:
"Developer License of the Amyuni PDF Converter Professional for Windows"
So should I be having this problem?
John
Re: Set Password In VBA - RESOLVED
I think the problem was were I placed the activation line. "pdf.EnablePrinter LicensedTo, ActivationCode"
I made sure it was after the "pdf.SetDefaultConfig" line and I think that fixed it.
Thanks,
John
I made sure it was after the "pdf.SetDefaultConfig" line and I think that fixed it.
Thanks,
John