MY BAD!!
I had the following code in the Document_Open event which precluded unprotecting the document.
So in fact, macros/VBA is enabled with the document,
BUT it still opens as READ-ONLY.
Code:
If ThisDocument.Name = "U3TO.docm" And ThisDocument.ReadOnly = False Then
Select Case ThisDocument.ProtectionType
Case wdAllowOnlyComments
'This is the protection that the file should find itself in.
ThisDocument.Unprotect Password:=conPass
Case wdAllowOnlyFormFields
MsgBox "Only Form Fields, this SHOULD NOT BE RECEIVED"
ThisDocument.Unprotect Password:=conPass
Case wdAllowOnlyReading
MsgBox "Only Reading, this SHOULD NOT BE RECEIVED"
ThisDocument.Unprotect Password:=conPass
Case wdAllowOnlyRevisions
MsgBox "Only Revisions, this SHOULD NOT BE RECEIVED"
ThisDocument.Unprotect Password:=conPass
Case wdNoProtection
'No action, had to trap no protection in case file was saved unprotected.
End Select
End If
I've changed the code to:
Code:
If ThisDocument.Name = "U3TO.docm" Then
Select Case ThisDocument.ProtectionType
Case wdAllowOnlyComments
'This is the protection that the file should find itself in.
ThisDocument.Unprotect Password:=conPass
Case wdAllowOnlyFormFields
MsgBox "Only Form Fields, this SHOULD NOT BE RECEIVED"
ThisDocument.Unprotect Password:=conPass
Case wdAllowOnlyReading
MsgBox "Only Reading, this SHOULD NOT BE RECEIVED"
ThisDocument.Unprotect Password:=conPass
Case wdAllowOnlyRevisions
MsgBox "Only Revisions, this SHOULD NOT BE RECEIVED"
ThisDocument.Unprotect Password:=conPass
Case wdNoProtection
'No action, had to trap no protection in case file was saved unprotected.
End Select
End If
Is there code to change READ-ONLY?