Sonya,
This is standard Word functionality; if a document is protected, access to
the Page Setup functionality is restricted. You would need to unprotect the
document first to gain access to this functionality again. You might be able
to write a macro that unprotects the document, displays the Page Setup dialog
box and then re-protects the document again, but you would not be able to use
any sort of method designed to intercept the standard File | Page Setup
command because (as you have no doubt seen) this menu command is disabled
when the document is protected. Instead you would have to provide an
alternate means of access to your macro - possibly through a custom toolbar
button or menu command. The code would look something like this:
Sub SetupPage()
Dim ProtectionType As Long
' Create a variable to store the current protection type
ProtectionType = ActiveDocument.ProtectionType
' Record the current protection type
' (which will be 0 if the doc isn't protected and NOT 0 if it is)
If ProtectionType <> 0 Then ActiveDocument.Unprotect "password"
' If the doc is protected then unprotect it
' supplying the password (if one is required)
Dialogs(wdDialogFilePageSetup).Show
' Show the Page Setup dialog box (which will be modal so the user
' can't get "behind" it and change something)
If ProtectionType <> 0 Then ActiveDocument.Protect ProtectionType, True,
"password"
' When the dialog box is closed, re-protect the document using
' the same protection type as it had to begin with, setting the
' NoReset argument to "True" (so any formfields in the document
' aren't reset) and supplying the password (if one is required)
End Sub
--
Cheers!
Gordon
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.