cancel
Showing results for 
Search instead for 
Did you mean: 

MS Word VBO - ExportPDF - How to set password during export

ManishKumar3
Level 3
Hi,  While exporting doc to pdf, i need to password protect pdf. Any help is well appreciated. Thanks.
1 BEST ANSWER

Best Answers

InJoeKhor
Staff
Staff
Hi Manish,

You can use Utility - PDF to set password on pdf.

Here is the link to the Utility.
https://digitalexchange.blueprism.com/dx/entry/58413/solution/utility---pdf

Cheers,

------------------------------
In Joe Khor
Sr. Product Consultant
Blue Prism
------------------------------
In Joe Khor Sr. Product Consultant Blue Prism

View answer in original post

2 REPLIES 2

InJoeKhor
Staff
Staff
Hi Manish,

You can use Utility - PDF to set password on pdf.

Here is the link to the Utility.
https://digitalexchange.blueprism.com/dx/entry/58413/solution/utility---pdf

Cheers,

------------------------------
In Joe Khor
Sr. Product Consultant
Blue Prism
------------------------------
In Joe Khor Sr. Product Consultant Blue Prism

MadhurChopra
Staff
Staff
Hey Manish,

Are you using the Word VBO to export to PDF? If so, I am afraid there is no way to password protect the PDF. Office's Object Model does not support encrypting PDF on export that can be called leveraged in the VBO, as can be seen at https://docs.microsoft.com/en-us/office/vba/api/word.document.exportasfixedformat.

Since yours is a specific use case, I'll suggest spying all necessary elements of the Word application and then using them as part of your automation to specify Encrypt options and the password.
The process is File > Save As > More Options... > Save as type: PDF (*.pdf) > Options... > Encrypt the document with a password > OK > Enter password > Re-enter password > OK > Save

I tried spying the elements and was successfully able to do so using UI Automation and Accessibility modes. I will suggest Accessibility mode as I found it to work better.

Hope this helps.

Regards.

------------------------------
Madhur Chopra
Sr. Product Consultant
Blue Prism - Professional Services
America/Los_Angeles
------------------------------