View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
SP SP is offline
external usenet poster
 
Posts: 12
Default print button for specific pages

Thank you so much. Between your information and information I found on how
to print the checklist without the button showing on the printed form, I was
able to code this perfectly!

Thanks again!!!!!!!!!!!
Sue


"Bear" wrote:

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