Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save report as pdf with password ?? 2

Status
Not open for further replies.

hovercraft

Technical User
Jun 19, 2006
236
US
I've been looking all over the web and various KB's at MS but have not been able to find any information. I could resolve this by using Word's "save as" via VBA but that runs into many many more problems.

I'm trying to utilize the "save as pdf" add-in from MS Access 2007 but I need to password protect the file programmatically as well. This is for an invoice-type production letter.

I've found code to do this in Word however my dataset results in the possibilty of having multiple records per invoice # (letterid) which can not be done for reoccuring runs in Word.

Can anyone please help me? I'm stuck inbetween a rock and hard place for sure!

Thanks,
Dave
 
For the password part, if you have Adobe Acrobat Pro, you can script that piece of it, I believe. I've only used Standard Edition, myself, so I was always unable to use that piece. I didn't think my needs for it would warrant using the Pro version vs Standard license at work, so I just did without the scripting myself. [sad]
 
Thanks for answering KJV. According to Adobe, this is not possible. They do not expose the security settings to VBA. However, I did find a solution that I think I will post in a FAQ. Short answer is, you must use a 3rd party application that exposes it's own methods of setting security. PDFCreator is the app that did the trick. It's open source and has supporting docs for programming. I ran a few tests and it works!
So of course my question is now...so if PDFCreator can access the security properties, methods etc, why the heck can't I. but it's really moot since I have a working end result.

Thanks again,
Dave
 
Yeah, I didn't think Adobe's stuff was exposed to VBA. I was speaking more-so of actually coding that within Acrobat's scripting language - I forget what it uses. But if you can use the other app, by all means, go with it! [smile] Glad you got a working solution.
 
Star for mentioning the exact method you used, in case anyone else needs the same. I know I want (currently), but if anything stays the same it's change.. [spineyes]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top