Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I tell if lines will wrap in Word

1 view
Skip to first unread message

Ethan Strauss

unread,
Jul 14, 2009, 2:37:01 PM7/14/09
to
Hi,
I am using C#.net with VSTO to make an addin for Word. I have some
specific text I woudl like to format in specific ways. I would like to know
if the ends of lines are actually wrapping to the next line. If they are, I
will reduce the font size. Is there a way I can tell if the lines are
actually wrapping?
Thanks,
Ethan

Cindy M.

unread,
Jul 15, 2009, 2:31:12 PM7/15/09
to
Hi Ethan,

Mmm. Basically, the answer to your question is, No. You can't really know this
ahead of time. You can only determine it once it's already happened - and
there is no event that will tell you it's happened.

If you've written the text to the document (using Range.Text, preferably), you
can get the number of lines like this:

Range.ComputeStatistics(wdStatisticLines)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

0 new messages