> Hi,
>
> I think all you need is a rightaligned tab
> instead of a decimal tab.
2 reasons I'd rather adjust decimal tabs:
1 - Decimal tabs can align text if there is no explicit "tab"
character in a cell. That is a very handy feature.
2 - I still want closing parentheses, % signs, multiple signs and any
other post number characters to hang over the right side, just like
they do with decimal tabs.
Thanks for your suggestion though. If anyone knows how to figure out
the width of one numeric character at run-time, I'd still really
appreciate it.
Do most fonts have monospace numbers? If so, maybe the way to go
would be to store a list of relations between font number width and
point size for different fonts that I use and look it up at run time.
Any other suggestions?
Jonathan West - 02 Dec 2004 16:27 GMT
>> Hi,
>>
[quoted text clipped - 13 lines]
> the width of one numeric character at run-time, I'd still really
> appreciate it.
Position the cursor before the digit.
Read the value of Selection.Information(wdHorizontalPositionRelativeToPage)
Move the cursor after the digit
Read the value of Selection.Information(wdHorizontalPositionRelativeToPage)
The difference between the two values is the width of the character in
points.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Helmut Weber - 02 Dec 2004 16:58 GMT
Hi,
only in explicitly monospaced fonts, I'd say, do digits
have the same width. Unless You want to take off an extra
half year and study how two extract data from font files,
you may very approximately (!) get the width of characters
by placing the cursor left of a digit, reading the
cursor position, placing it right of a digit, reading
the cursor position again, and calculating the difference.
Like, if the cursor is at the start of "1234567890":
Sub test491()
Dim i As Integer
Dim x1 As Single
Dim x2 As Single
For i = 1 To 10
x1 = Selection.Information(wdHorizontalPositionRelativeToPage)
Selection.MoveRight
x2 = Selection.Information(wdHorizontalPositionRelativeToPage)
MsgBox x2 - x1
Next
End Sub
Try with different screen resolution, with different
zoom factors, with different printer drivers. No luck it in!
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
>> Hi,
>>
[quoted text clipped - 19 lines]
>
>Any other suggestions?