Comment.Reference.Information(wdFirstCharacterLineNumber) error

T

Tony

To get page and linenumbers from comments inserted in a
word document I use:

for each objComment in Activedocument.Comments
iPage = objComment.Reference.Information
(wdActiveEndPageNumber)
iLine = objComment.Reference.Information
(wdFirstCharacterLineNumber)

Msgbox "Comment at page: " & iPage & " line: " & iLine
next objComment

This piece of code used to work fine but somehow suddenly
the linenumber returned is -1.

Also the pre-requisite for Options.Pagination and
ActiveDocument.ActiveWindow.View.Draft are set to resp.
True and False as instructed in the VBA help (see quote
from help file below).

wdFirstCharacterLineNumber Returns the line number of
the first character in the selection. If the Pagination
property is False or the Draft property is True, returns -
1.

Question: Is there a solution or workaround available or
does anyone experience the same problem?

OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 1 Build 2600
Word 2000, 9.0.6926 SP-3
 
H

Helmut Weber

Hi Tony,
try switching from printview to normalview and back,
beforehand.
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
G

Guest

Hi Helmut,

Thanx! Just switching to PrintPreview and back seems to do
the trick!

I wonder why this extra step is needed for line numbering?
The page number seems to work ok without the trick, any
explanation?

Grtz, Tony
 
H

Helmut Weber

Hi Tony,
no explanation,
and as far as I recall, this problem didn't occur
in Word 97.
Helmut Weber
 

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