Word VBA Selection.Information(wdFirstCharacterLineNumber)

N

nectar

Good day;

I'm having a problem with Selection.Information(wdFirstCharacterLineNumber)

I need this information to extract detailed line statistics.

My template has a text-box on the left side with a company column.
(graphic, phone number ...)

When in "Print Layout" view mode (showing me the text box) the method above
still returns me the line number as if in "Normal" mode (where I can't see
the text box).

Is there any way around this, I need to compute statics based on the printed
output.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?bmVjdGFyQG9ubGluZS5ub3NwYW0=?=,

I'm surprised you're getting any useful information, at all. When I insert a
text box (Drawing toolbar), have the selection in it, and run the code you
propose, I get -1, meaning the current state isn't valid for this command.

Text boxes and all other drawing objects are not in the text layer of the
document, but in the Drawing layer. They follow a completely different set of
rules, and you can really only use the properties of the Shapes and TextRange
collections.

Try converting the text box to a FRAME (Format dialog box/Text box tab) and see
if that helps at all.
I'm having a problem with Selection.Information(wdFirstCharacterLineNumber)

I need this information to extract detailed line statistics.

My template has a text-box on the left side with a company column.
(graphic, phone number ...)

When in "Print Layout" view mode (showing me the text box) the method above
still returns me the line number as if in "Normal" mode (where I can't see
the text box).

Is there any way around this, I need to compute statics based on the printed
output.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :)
 

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