Microsoft Office Tutorials and References
In Depth Information
Printing a UserForm
Printing a UserForm
This procedure demonstrates how to print a UserForm with more flexibility
than using the PrintForm method.
Example file:
E036.xls
Scenario: Printing a UserForm is a good way to store
information; for example, you might want to print a
UserForm that contains the information of a new customer
for a hard-copy file. Unfortunately, there is not much
flexibility in printing UserForms in Excel. Control over the
paper orientation, margins, or any of the other settings that
can normally be changed require code when printing
UserForms.
This procedure uses Microsoft Word to print the UserForm.
Exl
Figure 37 – Printing a UserForm
View the Appendix to learn how to store this procedure
in a Standard module.
Option Explicit¶
' * * * * *¶
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _¶
ByVal bScan As Byte, ByVal dwFlags As Long, _¶
ByVal dwExtraInfo As Long)¶
Private Const VK_SNAPSHOT = &H2C¶
 
Search JabSto ::




Custom Search