Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Read all lines in document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger - 09 Feb 2005 17:06 GMT
Is it possible to loop through an entire word document on a line - by - line
basis?

If so, how?

Thanks,

Roger
Greg Maxey - 09 Feb 2005 22:11 GMT
If you have Word2003, you can try:

Sub IterateDocLines()

Dim pPage As Word.Page
Dim pLine As Word.Line

For Each pPage In ActiveWindow.ActivePane.Pages
   For Each pLine In pPage.Rectangles(1).Lines
       Debug.Print pLine.Range
   Next
Next

End Sub

Signature

Greg Maxey/Word MVP
A Peer in Peer to Peer Support

> Is it possible to loop through an entire word document on a line - by
> - line basis?
[quoted text clipped - 4 lines]
>
> Roger
Roger - 10 Feb 2005 13:05 GMT
Thanks

> If you have Word2003, you can try:
>
[quoted text clipped - 19 lines]
>>
>> Roger
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.