I am writing an automated application (.NET 1.1 C#) that is used to remove the password from 1000’s of .doc files. The application also has a rollback feature, which means passwords have to reapplied to these files. I don’t seem to be able to set a password on my .doc files using the Protect() method. I receive no error/exceptions.
The code snippet is as follows:
string MyPassword = "PWD123456" SaveOptions so = SaveOptions.CreateSaveOptions(docFileName); _Doc.Protect(ProtectionType.NoProtection, MyPassword); _Doc.Save(docFileName, so);
The only requirement is to add a password to my file and save. The document is saved but the password is not applied, I have no need to protect the document or parts of it, in any other way.
Can someone please advise :o)