PDA

View Full Version : Print a UserForm



Student1000
05-27-2010, 03:33 AM
I would like to print a userform that displays all the important results.

Currently I am using this code:


Private Sub CommandButton2_Click()
Me.PrintForm
End Sub


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

GTO
05-27-2010, 03:51 AM
Not sure if this will help, but try:

With the form running, ALT + PrintScreen
Paste to a word doc and size to desired

Student1000
05-27-2010, 03:56 AM
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

GTO
05-27-2010, 07:59 AM
This seems to work. It did seem that the height/width might be a tad off.

http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/def468a2-a317-496e-85a1-ab37bd449264

lucas
05-27-2010, 10:29 AM
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.