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





    Tuesday, September 27, 2011 5:28 AM


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 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
  • 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 ?




    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 for details.

    • 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


    • 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