Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create a button in Word to print current page (Word XP)

    I have a document in Word which has hyperlinks to different parts in the document. I want to create a button in this document for people to click on to print the current page. Any suggestions as to how I can do this, if this is possible. Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Create a button in Word to print current page (Word XP)

    The one line VBA code
    <code>ActiveDocument.PrintOut Range:=wdPrintCurrentPage</code>
    Will print the current page to the default printer.

    You could create this as a simple Macro and assign it to a toolbar button. Is this what you want?

    StuartR

  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a button in Word to print current page (Word XP)

    It is, but I don't want to create a toolbar button, I want to have a button or whatever in my Word document that people can click to send the current page to print. I hope this make sense to you.

  4. #4
    Gold Lounger Rebel's Avatar
    Join Date
    Jul 2001
    Location
    Canada
    Posts
    3,024
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create a button in Word to print current page

    Create a command button and assign this code to it:

    <pre>Private Sub CommandButton1_Click()
    Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
    wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
    ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
    False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
    PrintZoomPaperHeight:=0
    End Sub
    </pre>

    John
    A Child's Mind, Once Stretched by Imagination...
    Never Regains Its Original Dimensions

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Create a button in Word to print current page (Word XP)

    You can use a Macrobutton field to run a Macro.

    For example, if you call your Macro PrintThisPage, you could have a field that looked like the attached image (the picture was just pasted into the appropriate place in the field code).

    StuartR
    Attached Images Attached Images
    • File Type: gif x.GIF (870 Bytes, 5 views)

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Create a button in Word to print current page

    Wow, so many choices! A MACROBUTTON field needs to be double-clicked. Your users may find that completely natural, or not get it at all. The Control Toolbox button only needs to be single-clicked (single-pressed?). However, in some cases, the user might see a Design Mode toolbar or other strange artifact when opening the document. Probably a good idea to test in your environment and see what works best for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •