Solved

PrintForm -- center on page?

Posted on 2004-04-08
4
870 Views
Last Modified: 2012-05-04
I'm using the PrintForm command... however, I'd like to center the image on page... how is this possible?

I tried experimenting with this code over here, but haven't came up with much... http://support.microsoft.com/default.aspx?scid=KB;en-us;q148392

Any assistance is appreciated...

NC
0
Comment
Question by:NO_CARRIER
  • 3
4 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 10784469
Will this work?

'apply same scale mode to printer
Printer.ScaleMode = Form.ScaleMode

'position current printing coordinates
Printer.CurrentX = (Printer.ScaleWidth - Form.ScaleWidth) / 2
Printer.CurrentY = (Printer.ScaleHeight - Form.ScaleHeight) / 2

'print form
Form.PrintForm
0
 
LVL 7

Accepted Solution

by:
Burbble earned 100 total points
ID: 10797686
Unfortunately, the .PrintForm method simply sends the image to the printer directly so you cannot alter it.

What you would have to do is save an image file (bitmap) of the form, and then set the Printer's CurrentX and CurrentY and finally .PaintPicture the saved image.

Here's some good example code that will help you with this:

http://www.thescarms.com/vbasic/capture.asp


-Burbble
0
 
LVL 7

Expert Comment

by:Burbble
ID: 10797692
The example prints the image fit to page (scales it as big as possible), but you can easily remove that portion of the code to circumvent that from happening.

-Burbble
0
 
LVL 7

Expert Comment

by:Burbble
ID: 10894482
Glad to be of assistance ;-)

-Burbble
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question