?
Solved

Print center

Posted on 2001-06-09
2
Medium Priority
?
215 Views
Last Modified: 2010-05-02
How do I print ...in the center of the page?
0
Comment
Question by:Object_shun
[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
2 Comments
 
LVL 13

Accepted Solution

by:
samic400 earned 80 total points
ID: 6171262
To printer in the middle of a line, you'll need to figure out the width of the text you're about to print, then begin printing 1/2 that difference between that width and the width of the printer object. This involves the use of the method textwidth, which gives the length (in the current scalemode) of a text string.

printer.currentx = (printer.width - printer.textwidth("print string")) / 2 printer.print "print string"

0
 

Expert Comment

by:sjulian
ID: 6686393
When I use this technique, it prints off center to the right.  Whenever I use textwidth I do not get the expected results.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses
Course of the Month15 days, left to enroll

770 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