TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Need Word macro - search, highlight, create new doc
Subject:Need Word macro - search, highlight, create new doc From:anewton -at- EDUPRISE -dot- COM To:techwr-l Date:Fri, 18 Feb 2000 9:18:41
Hello,
This message is cross-posted to WinHlp-l.
Word 97 on Windows 98. . .
I can record the odd Word macro here and there, but at some point I need to
stand back and admit that I'm really just a macro stooge. . .
I was wondering if anyone out there has, can create, or can point me to a
Word VBA macro that would do the following:
1. Search for a word or phrase in a paragraph with a certain Word style
applied. For instance, search the document for all instances of "workers of
the world unite" in a paragraph styled as "Whatever". (I know you can do
this manually through Word's search/replace). . .
2. In the open document, I'd like the search to highlight (or otherwise
make distinct) the entire paragraph that contains the appropriate search
string and style.
3. I'd like the macro to also open a new Word document and copy each
paragraph into the document, preferably preserving the style of each
paragraph, inserting a page reference indicating where in the original
document the paragraph is, and inserting a carriage return or two between
ea. paragraph for ease of viewing.