How Many Characters per Line

T

Thierry Marneffe

Hello

Is there a way to know the number of characters per line in Header or
Footer, giving the current font ?

Thanks for your help

Thierry
 
J

Jay Freedman

Hello

Is there a way to know the number of characters per line in Header or
Footer, giving the current font ?

Thanks for your help

Thierry

No, not unless you apply a nonproportional font. If the font is
proportional (as most are), think what happens if the line is filled
with many copies of the letter 'i', opposed to what you get if the
line consists of copies of 'W' or 'M'.
 
C

Chuck

This should work anywhere (in a table or not). It gives a count of the number
of characters in a line wherever the insertion point is located. You could
also use a range instead of a selection although range doesn't appear to
support the "Expand wdLine" which might make expanding a range to an entire
line a little more tricky than expanding a selection...

Selection.Expand wdLine
With Dialogs(wdDialogToolsWordCount)
.Execute
MsgBox "This line contains " & .Characters & " characters."
End With

In other words, Dialogs(wdDialogToolsWordCount).Characters gives you a
string with a count of the characters in a selection.

Adapated from code posted by Dave Lett
(http://www.microsoft.com/communitie...7b8f4d-c42c-4116-bf57-5c7ffaf6230d&sloc=en-us)
 

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