C
chuckvorndran
I'm struggling trying to calculate the width of a text range, in real-world
units, in Word 2003 using C#. I need to get a number that I can use to set a
table column width or to find the physical beginning position, in terms of
ruler measurements, for the beginning of a right justified single line
paragraph. For instance, the value rng.Paragraphs[1].Range.End may be 15
(characters or spaces), but I really need to know how many points, cm, or
inches that really is. (Yes, the actual width of displayable text is 14.) I
know that it depends on the Font, print drivers, actual characters used, etc,
but internally Word already should have done that calculation. Maybe, I just
need to know how to get at it.
Also, how do I programmatically check for a wrapped line, i.e. one that is
physically too long to fit on a single line.
I would think that this isn't an entirely uncommon task, but I haven't seen
any documentation on this particular aspect.
Thanks.
units, in Word 2003 using C#. I need to get a number that I can use to set a
table column width or to find the physical beginning position, in terms of
ruler measurements, for the beginning of a right justified single line
paragraph. For instance, the value rng.Paragraphs[1].Range.End may be 15
(characters or spaces), but I really need to know how many points, cm, or
inches that really is. (Yes, the actual width of displayable text is 14.) I
know that it depends on the Font, print drivers, actual characters used, etc,
but internally Word already should have done that calculation. Maybe, I just
need to know how to get at it.
Also, how do I programmatically check for a wrapped line, i.e. one that is
physically too long to fit on a single line.
I would think that this isn't an entirely uncommon task, but I haven't seen
any documentation on this particular aspect.
Thanks.