Width of string character in pixels

S

Sal

Does anybody know how to get the width of a string character like 'W' in
pixels?
Any help would be greatly appreciated.

Sal
 
M

Marshall Barton

Sal said:
Does anybody know how to get the width of a string character like 'W' in
pixels?
Any help would be greatly appreciated.

Stephen Lebans knows how. ;-)

Check his web site at www.lebans.com

I would start with his TextHeightWidth function.
 
J

John Vinson

Does anybody know how to get the width of a string character like 'W' in
pixels?

In... which font? Comic Sans Bold 48 point will have a lot more pixels
than Arial Narrow 6 point... and for that matter, even with a
consistant font the number of pixels will depend on the user's screen
settings and even their monitor hardware.

What exactly are you trying to accomplish?
 
S

Sal

John,
I am creating an email format to send confirmation for Orders that customers
make. I would like it to be formatted like a sales order showing Items sold
as follows

Qty Item Unit Extended

I have written a function that based on number of columns (in this case
four) and length of my entries from database aligns the columns. I give a
column width for each column and if for example Item description is smaller
than column width I would like to pad it so the next column is aligned.
Using spaces does not work so I want to go with the widest Character for
example (W) to achieve this.
Any suggestions? Any better way that you can think of?

Thanks,
Sal
 
J

John Vinson

I am creating an email format

.... which means that you have absolutely NO control over the width,
since you have no way of predicting what font the recipient of the
email will use to display their message!

This sounds like a really tough one, and no, I fear I have no
suggestions other than to follow the link posted elsewhere in this
thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top