Peter H.
asked on
word automation decrypt document file
I have a number of old word documents that I need to migrate to pdf but first I need to save them as DOCX but I want to save them without the Encryption password (which I have).
Anybody know how to do this?
Anybody know how to do this?
https://support.office.com/en-us/article/Password-protect-documents-workbooks-and-presentations-ef163677-3195-40ba-885a-d50fa2bb6b68
ASKER
I need to create a program to do this in C# or VFP, it is easy enough to do this manually.
I need to create a program to do this in C# or VFP, it is easy enough to do this manually.
i guess i didn't guess what you wanted―i don't really program that well :-(
Is there any reason that you can't use VBA?
ASKER
What I need to do is use word automation from within an application.
Keep in mind that I have not done this myself, so what I recommend is based solely on how I generally approach VFP Automation of Office, but it might only be worth everything you had to pay for it......
I'd start in Word without VFP.
1. Open the password protected document into Word
2. Find out how to, within Word, do a SaveAs with No Password protection.
Now that you know how to do it in Word, set up to record a Macro and do the same steps again.
Now Stop recording the Macro and review it through Edit
It should show you the steps necessary for your VFP Automation to do for the 2nd part of the task.
Now on to the first part - using VFP Automation to open the password protected document
1. Create something like oWord = CREATEOBJECT("word.applica tion")
2. Now Open your Document oDoc = oWord.Documents.Open(oDocu ment,,,,,) && Apparently the 5th parameter can be your document's Password
Once you can Open the password protected document, continue with your VFP Automation code to implement what you learned above about saving the document.
If you get it working, we might like to see your VFP Automation code.
Good Luck
I'd start in Word without VFP.
1. Open the password protected document into Word
2. Find out how to, within Word, do a SaveAs with No Password protection.
a. That might be to Remove the Password protection first
b. And then to do your SaveAs...
Now that you know how to do it in Word, set up to record a Macro and do the same steps again.
Now Stop recording the Macro and review it through Edit
It should show you the steps necessary for your VFP Automation to do for the 2nd part of the task.
Now on to the first part - using VFP Automation to open the password protected document
1. Create something like oWord = CREATEOBJECT("word.applica
2. Now Open your Document oDoc = oWord.Documents.Open(oDocu
Once you can Open the password protected document, continue with your VFP Automation code to implement what you learned above about saving the document.
If you get it working, we might like to see your VFP Automation code.
Good Luck
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.