Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Selecting a line after finding a word

0 views
Skip to first unread message

Akhilesh Agarwal

unread,
Sep 21, 1999, 3:00:00 AM9/21/99
to
Hi !!!

I am searching through a word document using .Find method. After I find the
particular text I am looking for I want to select the line which contains
this text.

Is is possible to do so ? Please help....

Thanks,

Akhilesh.


Jonathan West

unread,
Sep 21, 1999, 3:00:00 AM9/21/99
to
Hi Akhilesh,

Select the found text using the Select method (if you haven't already been
applying the Find method to the Selection). Then use the following line of
code to select the entire line

ActiveDocument.Bookmarks("\Line").Range.Select

There are a number of predefined bookmarks in Word which move & change to
mark text relative to the selection. \Line is one of them.

Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email

Akhilesh Agarwal wrote in message <#o83AdFB$GA.75@cppssbbsa04>...

Barry Schwarz

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to
Find selects the text. Position in the selected range. Move to one end of the
line. Move to the other end with select specified.

In article <#o83AdFB$GA.75@cppssbbsa04>, "Akhilesh Agarwal"

0 new messages