Search code examples
wordml

make wordml readonly


how i caon make a wordml read-only from .

any ideas??


Solution

  • Adding the following to your WordML document will tell Word to treat its contents as read only:

    <w:wordDocument>
      <w:docPr>
        <w:documentProtection w:edit="read-only" w:enforcement="on" w:unprotectPassword="5349CC3D"/>
      </w:docPr>
    </w:wordDocument>
    

    w:unprotectPassword is "1234" in this example but this attribute is not required. If an unlock password is not included Word will allow the user to just turn the read only state of the document off without challenging them.

    Hope that helps and is what you are looking for!