View Single Post
 
Old 12-07-2014, 06:32 PM
pooklet pooklet is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Dec 2014
Location: Melbourne, Australia
Posts: 2
pooklet is on a distinguished road
Default Macro to Unprotect password protected document

Hi There

I am having trouble getting a macro to work in Word 2013 to un protect a password protected document, then re protect. I get the error Argument not optional and have no idea what this means.

I eventually want the macro to unprotect the document, insert a row in a table then reprotect the document.

Can someone please help.


If ActiveDocument.ProtectionType <> wdNoProtection Then
>> ActiveDocument.Unprotect Password:="password1"
>> End If
>>
>> If ActiveDocument.ProtectionType = wdNoProtection Then
>> ActiveDocument.Protect _
>> Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="password1"
>> End If
End Sub


thanks so much Carol
Reply With Quote