View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Bear[_2_] Bear[_2_] is offline
external usenet poster
 
Posts: 314
Default print button for specific pages

Sue:

I have two suggestions, both require a little knowledge of macros.

1. Record a macro of printing the current page. Save it in the template used
for the document. You can edit out most of the parameters and use just:

Sub x()
'
' x Macro
' Macro recorded 5/1/2007 by David Chinell
'
Application.PrintOut _
Range:=wdPrintCurrentPage, _
Item:=wdPrintDocumentContent, _
Copies:=1

End Sub

Attach this to a custom button (storing the customization in the template,
not the document). Alternately, create a MacroButton field that calls the
macro.

2. Rather than use the current page, set each form as a separate section,
and print that section. I think the section number may act more predictibly,
and will allow multiple-page forms. Your code would look like:

Sub x()
'
' x Macro
' Macro recorded 5/1/2007 by David Chinell
'

Dim strSection As String

strSection = Format(Selection.Information(wdActiveEndSectionNum ber))
strSection = "s" & strSection

Application.PrintOut _
Range:=wdPrintRangeOfPages, _
Pages:=strSection, _
Item:=wdPrintDocumentContent, _
Copies:=1

End Sub

Bear
--
Windows XP, Word 2000