Jay
Sat Mar 10 15:57:23 CST 2007
A macro like that would be possible, although I can't say without
trying it whether the comment/annotation would come along.
There would have to be some preliminary code in the macro to open the
document containing the replacements (assuming the document to be
modified is already open), and set up some variables.
The core of the code would be a loop that steps through the rows of
the replacements table. For each row, it would run an inner loop that
uses the Find property of a Range object to search the active document
for the text from the first column. Each time it's found, the code
would replace the found text with the contents of the second column,
using the Range object's .FormattedText property.
It wouldn't be very hard to program, but it isn't something you can
just throw together -- there are usually some fiddly bits that need
tweaking after you test it with the real data.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
On Sat, 10 Mar 2007 09:34:00 -0800, Macro''''er
<Macroer@discussions.microsoft.com> wrote:
>Sure. I have a document with 2 columns that will consist of 500+ words or
>phrase:
>
>First column = Word ****(Plain text)
>Second column = Word *******(formatted with bold, italics, with annotation)
>
>I'm looking for a macro that will find the first column "Word" in my active
>document and Replace with second column "Word" and format it Bold, Italics,
>display the comment and with highlight.
>
>Thank you and hope my request makes sense.
>
>--
>Smile...it is good for you! :)
>
>
>"Jay Freedman" wrote:
>
>> To be honest, I can't quite grasp what you want to do. What does a
>> document full of AutoText entries have to do with Find/Replace? Can
>> you expand a bit on the purpose?
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ:
http://word.mvps.org
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
>>
>> On Fri, 9 Mar 2007 09:57:03 -0800, Macro''''er
>> <Macroer@discussions.microsoft.com> wrote:
>>
>> >Thank you, it works really well!
>> >
>> >I have another question...can I leverage the AutoText Back up document to
>> >find and replace in my active document? Hope my question make sense.
>> >--
>> >Smile...it is good for you! :)
>> >
>> >
>> >"Jay Freedman" wrote:
>> >
>> >> You can download the AutoCorrect.dot template from
>> >>
http://www.word.mvps.org/FAQs/Customization/ExportAutocorrect.htm.
>> >> That template contains a macro that can both create and reload a
>> >> document containing AutoCorrect entries.
>> >>
>> >> If you need a version of that template for Word 2007, I've posted that
>> >> at
http://jay-freedman.info/AutoCorrect2007.zip.
>> >>
>> >> --
>> >> Regards,
>> >> Jay Freedman
>> >> Microsoft Word MVP FAQ:
http://word.mvps.org
>> >> Email cannot be acknowledged; please post all follow-ups to the
>> >> newsgroup so all may benefit.
>> >>
>> >> On Thu, 8 Mar 2007 16:46:00 -0800, Macro''''er
>> >> <Macroer@discussions.microsoft.com> wrote:
>> >>
>> >> >I did, but I am so new at this creating macro and I'm hoping I can download a
>> >> >file just like the AutoTextLoader Jay provided. The download includes the
>> >> >userform and all. Thank you!
>> >> >-------------------------------
>> >> >Smile...it is good for you! :)
>> >> >
>> >> >
>> >> >"Greg Maxey" wrote:
>> >> >
>> >> >> You didn't by chance read the first response to your question did you?
>> >> >>
>> >> >>
http://gregmaxey.mvps.org/AutoCorrect_Generator.htm
>> >> >> --
>> >> >> Greg Maxey/Word MVP
>> >> >> See:
>> >> >>
http://gregmaxey.mvps.org/word_tips.htm
>> >> >> For some helpful tips using Word.
>> >> >>
>> >> >>
>> >> >> Macro''''er wrote:
>> >> >> > Hi Jay,
>> >> >> >
>> >> >> > It's me again. You don't by any chance have an autocorrect loader i
>> >> >> > can use, do you?
>> >> >> >
>> >> >> >> Helmut Weber wrote:
>> >> >> >>> Hi,
>> >> >> >>>
>> >> >> >>>> Hi. I have 100 words I need to enter in the AutoText database in
>> >> >> >>>> Word 2003. Can I create a macro instead of entering one by one in
>> >> >> >>>> the database.
>> >> >> >>>
>> >> >> >>> Yes. But it seems,
>> >> >> >>> AutoTextEntries.add
>> >> >> >>> expects not only a name, but a range in addition.
>> >> >> >>>
>> >> >> >>> So you have to put up some kind of list
>> >> >> >>> containing a name and an according range.
>> >> >> >>>
>> >> >> >>> Sure, doable.
>> >> >> >>> With only a hundred I don't know whether its economical for you.
>> >> >> >>
>> >> >> >> It's already done. Download
>> >> >> >>
http://jay-freedman.info/autotextloader2.zip and follow the
>> >> >> >> instructions.
>> >> >> >>
>> >> >> >> --
>> >> >> >> Regards,
>> >> >> >> Jay Freedman
>> >> >> >> Microsoft Word MVP FAQ:
http://word.mvps.org
>> >> >> >> Email cannot be acknowledged; please post all follow-ups to the
>> >> >> >> newsgroup so all may benefit.
>> >> >>
>> >> >>
>> >> >>
>> >>
>>