Page number of endnote

R

Ruslan

Hi,

In Word VBA, how could i find out the page number of a endnote?

thank you,

Ruslan.
 
D

Doug Robbins - Word MVP

Running the following code when the document containing the endnotes is the
active document will create a table in a new document containing then
endnote number, the endnote text and the number of the page on which the
text to which the endnote refers is located.

Dim source As Document
Dim target As Document
Dim aendnote As Endnote
Dim aenrange As Range
Set source = ActiveDocument
Set target = Documents.Add
For Each aendnote In source.Endnotes
Set aenrange = aendnote.Reference
target.Range.InsertAfter aendnote.Index & vbTab & aendnote.Range &
vbTab & aenrange.Information(wdActiveEndPageNumber) & vbCr
Next aendnote
target.Range.ConvertToTable


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Ruslan

Hi,

It is not the case. Sorry, it seems I was not presize enough. I need to
obtain the the page number of the endnote when I manipulate with the selected
endnote or with the range of endnotes (at particular the endnotes placed in
the end of the document). The problem is that I try to utilize function
"Selection.Information(wdActiveEndPageNumber)", but I get the page number of
the reference to the endnote, not the page of the currently selected endnote.
Probably it is a Word issue, but I am not sure. Do you know something about
this issue and do you know feasible alternative approach?

Thank you
 
D

Doug Robbins - Word MVP

I think that the number that you want is displayed in the status bar.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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