Solved

PrintForm -- center on page?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

736 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