• Default Print in UserForm

    Author
    Topic
    #352745

    I’m new at programming in WORD, but I can read the code. I attached a command button on a user form of a template and I want it to print to the users default printer. How would this code work?

    Viewing 1 reply thread
    Author
    Replies
    • #514005

      To get the code, record a macro. Then modify it if needed to use the default printer rather than a specific printer. See my answer to Jay Ratcliffe’s question of 2/08 on default printer for a document for some of the terms.

      You may want to consider using a macrobutton rather than an ActiveX control.

      See the links at http://www.addbalance.com/usersguide/forms.htm%5B/url%5D for more ideas.

      Hope this helps.

    • #514015

      Do you want to print the userform to the default printer, or the document itself?

      To print out the userform, use:

      Me.PrintForm

      And to print out the document, use:

      ActiveDocument.PrintOut

      Hope this helps,
      Gary

      • #514100

        Yes, that worked well.
        Sorry for not being clear. The UserForm was my target.

        How do you print out everything on the form except the 2 buttons, which are named “Close” and “Print”?

        • #514113

          Use this:

          Private Sub cmdPrint_Click()
          cmdPrint.Visible = False
          cmdClose.Visible = False
          Me.PrintForm
          cmdPrint.Visible = True
          cmdClose.Visible = True
          End Sub

    Viewing 1 reply thread
    Reply To: Default Print in UserForm

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: