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
|