?
Solved

PrintForm -- center on page?

Posted on 2004-04-08
4
Medium Priority
?
904 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

762 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