Endnote reference range

  • Thread starter Pablo Cardellino
  • Start date
P

Pablo Cardellino

Hi,
I need to match the position of the reference of an endnote within the
document. I almost did it by using
ActiveDocument.Endnotes(i).Reference.Start, but there is a diference of 41
from its actual position. For example, I have a note right in the 1996
character of the document, but ActiveDocument.Endnotes(i).Reference.Start
gives me 2037. This difference of 41 is the same for all the endnotes within
the document.

In other document, this doesn't happen. The note is right where
ActivDocument.Endnotes(i).Reference.Start says it should be.
Anybody knows why this happens with the first document, how I could
determine wether this difference will occur or not and, obviously how to
compute the difference automatically?

Best regards,
Pablo Cardellino
 
C

Cindy M.

Hi Pablo,
I need to match the position of the reference of an endnote within the
document. I almost did it by using
ActiveDocument.Endnotes(i).Reference.Start, but there is a diference of 41
from its actual position. For example, I have a note right in the 1996
character of the document, but ActiveDocument.Endnotes(i).Reference.Start
gives me 2037. This difference of 41 is the same for all the endnotes within
the document.

In other document, this doesn't happen. The note is right where
ActivDocument.Endnotes(i).Reference.Start says it should be.
Anybody knows why this happens with the first document, how I could
determine wether this difference will occur or not and, obviously how to
compute the difference automatically?
Field codes or hidden text could cause the numbers to vary, depending on how
you're querying them.

Usually, I'd avoid working with the Start and End position like the plague
because it is so unreliable. If I have to, then I make sure I work with Range
objects and compare those objects:
Dim rngEndnote as Word.Range
Dim endnoteStart as Long
Set rngEndnote = ActiveDocuments.Endnote(i).Reference
rng.TextRetrievalMode.IncludeFieldCodes = false
rng.TextRetrievalMode.IncludeHiddenText = false
endnoteStart = rng.Start

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 :)
 

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