print button for specific pages

S

SP

I have searched and haven't found an answer for this:

I have a Word document, with the first page being an index, being followed
by 20 checklists (ususally one or two pages long). Instead of creating 20
files and password protecting each, we placed them all in one document, with
the index having hyperlinks to each checklist (by bookmark). What I would
like to do is add a command button to each checklist's header so that when
the user clicks to access a specific checklist, they can press the command
button to print only that specific checklist. I know you can go to
file/print/and select which pages you want to print, but it would be easier
and quicker for us to have a simple button to do this. Besides, we get some
users that click the toolbar print button and end up printing all 20
checklists.
 
B

Bear

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(wdActiveEndSectionNumber))
strSection = "s" & strSection

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

End Sub

Bear
 
S

SP

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
 
B

Bear

Sue:

You're welcome. I'd love to hear how you arranged for the button not to
print on the form....

Bear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top