Consulting

Results 1 to 5 of 5

Thread: Print a UserForm

  1. #1

    Print a UserForm

    I would like to print a userform that displays all the important results.

    Currently I am using this code:

    [VBA]
    Private Sub CommandButton2_Click()
    Me.PrintForm
    End Sub
    [/VBA]

    However, my userform is too large to fit on a A4 paper. can I somehow open the printer menue before the print starts? so that i can enter "fit to paper size"?

    Furthermore, I have a listbox on my userform showing the top 3 results. by clicking on each of them the respective information are displayed on the userform. As a result, If i press print, it does not print only the active page, but all of the pages that correspond to the top 3 search results. How can I make sure that only the current active page is printed?

    thanks for any help.
    cheers

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Not sure if this will help, but try:
    • With the form running, ALT + PrintScreen
    • Paste to a word doc and size to desired

  3. #3
    Quote Originally Posted by GTO
    Not sure if this will help, but try:
    • With the form running, ALT + PrintScreen
    • Paste to a word doc and size to desired
    Well to be honest this is not what i am looking for... the user is really ignorant so everything should simply work when clicking on the "Print" Button.....

    any other suggestions?

    cheers

  4. #4
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    This seems to work. It did seem that the height/width might be a tad off.

    http://social.msdn.microsoft.com/For...1-ab37bd449264

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I don't understand why folks want to print a userform..

    Why not just transfer the results to a formated sheet and print it. You can make it look any way you wish and you save ink and headaches.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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