Wrox Programmer Forums
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2007, 10:45 AM
Registered User
 
Join Date: Sep 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Finding End of Document

How in VBA do you test for the end of the document? After finding & selecting some text and modifying its font properties, I move over one character and want to see if I'm now at the end of the document - in which case, I'll stop - and if not at the end of the doc, I'll go to the start of the code and repeat the Find.

Thanks!

Larry Landis
Technical Writer
 
Old September 11th, 2007, 11:31 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

One way is to check the EndoFDoc bookmark

Here is a hint

Sub IsTheTextEOD()

If Selection.Range = ActiveDocument.Bookmarks("\EndofDoc").Range Then
   MsgBox "EOD"
Else
   MsgBox "Still need to move further...."
End If


End Sub

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Front end Vs Back end ricmar Access VBA 3 May 27th, 2008 02:36 PM
Ms Access front End with Oracle 10g Back End rahul123 Oracle 1 July 9th, 2007 01:03 AM
Oracle back-end MS-Access 2003 client front-end Corey Access 2 February 16th, 2007 08:31 AM
Oracle Back End - MS Access Front End - Multi User ckaliveas Oracle 1 February 1st, 2007 06:00 AM
Finding a heading in a word document nesplb Pro VB 6 1 August 18th, 2003 04:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.