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.

Get the text between two words

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul robinson - 22 Feb 2005 13:52 GMT
Hi
I'd like to get the text between two words, say <START> and <FINISH>,
and assign that to a variable.
e.g.
<START>
This is my text.
<FINISH>

should assign "This is my text." to the string variable mytext, say.

If I had a lot of <START>, <FINISH> blocks in one file, how would I
loop through them?

I've used VBA in Excel quite a bit, but not in Word.

regards
Paul
Howard Kaikow - 23 Feb 2005 19:53 GMT
Look at Word's Find and Range objects.

Also, take a look at Steve Roman's book Writing Word Macros.

See http://www.standards.com/index.html?WordVBABooks

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> Hi
> I'd like to get the text between two words, say <START> and <FINISH>,
[quoted text clipped - 13 lines]
> regards
> Paul
paul robinson - 24 Feb 2005 09:42 GMT
Hi Howard
Thanks for that.
I'm used to the Excel NewsGroup....quiet in here isn't it....

Paul
 
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.