How does VBA detect the end of document in Word 2000?

P

Phil Horwood

I'm a Word VBA newbie trying to write a macro that inserts
a line number at the start of every line in a Word 2000
document. I can get it working with a For... Next loop,
but ideally I want to use a While... Wend loop that checks
that the insertion point is not at the end of the document
before inserting the next sequential number at the start
of the line.

Other newsgroups have suggested using the AtEndOfDocument
function, but I can't seem to find this in Word 2000 VBA.
Any help would be greatly appreciated. Thanks.
 
D

Doug Robbins - Word MVP

Hi Phil,

See the article "Determine if the insertion point is located at the end of a
document" at:

http://www.mvps.org/word/FAQs/MacrosVBA/SelectionAtEndOfDoc.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
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