

If Not ActiveDocument.ProtectionType = wdNoProtection ThenĪctiveDocument. This locking ensures that you are able to maintain the. Click Select Sections underneath and select all the other sections that are not part of your editable content, for example in your simple document that would be Section 1 and Section 3.
Under Editing Restrictions choose Filling in Forms. If iLoop > UBound(passWords) Then Exit Do This content Control cannot be edited by any other user and can only be changed at the authors computer. Click on Restrict Editing from the Review toolbar. If Not docToUnlock.Type = wdTypeDocument Thenĭo While Not ActiveDocument.ProtectionType = wdNoProtection If using Normal.dotm then in ThisDocument add: Private Sub Document_Open()Īnd (for testing) in a regular module add the following (you'll likely want to split this into separate units of code later): Sub unlocker(ByVal docToUnlock As Document) There are several reasons why a file opens in Protected View: The file was opened from an Internet location - When you see the message in Protected View that says 'Be careful - files from the Internet can contain viruses. If NOT using Normal.dotm then you will need to setup a global template AND trigger the code by creating your own application events as described here: Protected View is a read-only mode where most editing functions are disabled. Note 2: This will fail if you open more than 1 doc because only 1 password is stored - you could write the password as a document property (which you would retrieve & delete before saving and relocking).ĭepending on whether or not you are happy to add code to the Normal.dotm template (personally I'm not) will influence how you do this. dotm file and ultimately save as a global template on your PC (google). First, go ahead and open the Word document to be protected and head over to the Review tab. Note 1: You will need to put this into a. The format is a zip-file containing the text in the form of XML, graphics and other data that can be translated into a sequence of bits using patent-protected.
