Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
Larry
 
Posts: n/a
Default Page layout in a form - Word XP

I have a form that I have protected so that no one can change it. However,
people may need to change the printer tray from which it pulls the paper. Is
there a way to do this as Page Setup is disabled in protected forms?
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Jay Freedman
 
Posts: n/a
Default Page layout in a form - Word XP

On Tue, 6 Dec 2005 12:40:02 -0800, "Larry"
wrote:

I have a form that I have protected so that no one can change it. However,
people may need to change the printer tray from which it pulls the paper. Is
there a way to do this as Page Setup is disabled in protected forms?


You'll need a macro that unprotects the document, displays the Page
Setup dialog, applies only the printer tray assignment, and reprotects
the document. See http://www.gmayor.com/installing_macro.htm for how
to use the following code:

Public Sub PaperTray()
' if the form has a password:
'Dim strPWD As String
'strPWD = "g83Re7ghY9eh" or whatever it is

' unprotect form
If ActiveDocument.ProtectionType wdNoProtection Then
ActiveDocument.Unprotect ' Password:=strPWD
End If

Dim dlg As Dialog
Set dlg = Dialogs(wdDialogFilePageSetup)

With dlg
' display the dialog, but use only the trays
If .Display = -1 Then
ActiveDocument.PageSetup.FirstPageTray = .FirstPage
ActiveDocument.PageSetup.OtherPagesTray = .OtherPages
End If
End With

' reprotect form
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True ', Password:=strPWD
End Sub

If you have trouble getting the trays to be set correctly by this
macro, see the article at
http://pubs.logicalexpressions.com/P...cle.asp?ID=101 for a
more capable method.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
page number printing on a merged report Print Page # On Merged Report Mailmerge 6 October 17th 05 05:18 AM
how do i set up template in vbeditor without proggramming language ARRRGH New Users 4 October 1st 05 03:19 AM
Envelope Address GR New Users 5 April 24th 05 09:48 PM
How do I create & merge specific data base & master documents? maggiev New Users 2 January 12th 05 11:30 PM


All times are GMT +1. The time now is 12:11 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"