ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

Last post 03-09-2012, 3:33 AM by aspose.notifier. 6 replies.
Sort Posts: Previous Next
  •  07-29-2010, 5:05 PM 251193

    ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file. .NET

    Hi,

    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)

    ta
    James

     
  •  07-30-2010, 1:18 AM 251217 in reply to 251193

    Re: ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

    Hi

     

    Thanks for your request. It seems, what you are talking about is document encryption (i.e. you cannot open document without entering a password). Aspose.Words at the moment cannot encrypt documents, it can only apply document protection and set password to modify.

    http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/protecting-documents.html

    http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.document.writeprotection.html

     

    Aspose.Words, however, supports loading encrypted documents.

    Your request has been linked to the appropriate issue. You will be notified as soon as document encryption is supported.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-30-2010, 3:03 AM 251260 in reply to 251217

    Re: ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

    Hi,

    Just so I have my facts clear on this, it is not currently possible to password protect a document using Aspose, i.e. when the document is opened it asks the user to enter a password.

    If so, it seems odd as I am able to remove a password (set it to empty.string) from a Word doc and re-save without it; which is surely the same as setting a password?

    Kind Regards

    James

     
  •  07-30-2010, 3:50 AM 251270 in reply to 251260

    Re: ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

    Hi

     

    Thank you for additional information. You can change protection password, but you cannot change “Password to Open” (these are different things). If you open encrypted document using Aspose.Words, you need to pass the password as a parameter into Document constructor.

    After saving, the output document will not be encrypted, i.e. MS Word will not ask you to enter the password to open it.

    Also, please attach your input document here.

     

    Best regards,


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-30-2010, 4:07 AM 251276 in reply to 251270

    Re: ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

    Hi,

    Many thanks I think that confirms things.  It is the "Password To Open" that I wanted to change, however it seems that is not possible currently.

    Currently I open encrypted documents using the password as you say, then use the Unprotect() method to remove the "Password To Open" before saving, but it seems from your reply that I don't need to do that, in fact just saving the document will remove the "Password To Open".

    Many Thanks
    James

     
  •  07-30-2010, 6:40 AM 251294 in reply to 251276

    Re: ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

    Hi James,

     

    Thank you for additional information. You are right; Unprotect method has no effect on document encryption.

    We will let you know once encryption of documents is supported.

     

    Best regards,


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  03-09-2012, 3:33 AM 367007 in reply to 251193

    Re: ASPOSE.WORDS for .NET 1.1 - Adding Password protection to a .doc file.

    The issues you have found earlier (filed as WORDSNET-1724) have been fixed in this .NET update and this Java update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
    (7)
     
View as RSS news feed in XML