none
how can i protect word document using OPEN XML SDK RRS feed

  • Question

  • how can i protect word files using OPEN XML SDK.

    I can do it using traditional way by creating word objects.

    by how can i do it using OPEN XML SDK

     

    Thanks

    Prasad

     

    Tuesday, September 27, 2011 5:28 AM

Answers

All replies

  • Hi koolprasad2003,

     

    Thanks for posting in the MSDN Forum.

     

    Would you please clarify the mean of “protect”? There are five options about Protect document:

     

    1.         Mark as Final.

    2.         Encrypt with Password.

    3.         Restrict Editing

    4.         Restrict Permission by People

    5.         Add a Digital Signature.

     

    And which version SDK you will use to do it?

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, September 29, 2011 2:47 AM
    Moderator
  • Thanks for reply Tom,

    protect means Restrict Editing. how can Restrict Editing of word file. using interop.word i can protect my word file with

    objWord.Protect(Protectationtype.ReadOnly, "password")
    

     

    can i do same task using open XML.SDK.

    i have word2007, which version should i use ?

     

    thanks

    koolprasad2003

    Thursday, September 29, 2011 11:08 AM
  • You can do this with the SDK, but it involves encryption of the password, so it isn't the most straightforward task. See http://blogs.msdn..com/b/vsod/archive/2010/04/05/how-to-set-the-editing-restrictions-in-word-using-open-xml-sdk-2-0.aspx for details.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by koolprasadd Wednesday, October 5, 2011 6:25 AM
    Thursday, September 29, 2011 11:43 AM
  • Hi,

    Is there any way we can restrict the file using Open XML for the option 4 (Restrict Permission by People)?

    Thanks in Advance

    Marisan.


    • Edited by Marisan S Tuesday, January 29, 2013 11:36 AM
    Tuesday, January 29, 2013 10:56 AM
  • Code in that article no longer works.
    Tuesday, August 8, 2017 6:01 PM