Solved

PrintForm -- center on page?

Posted on 2004-04-08
4
865 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now