Group:  Microsoft Word ยป microsoft.public.word.oleinterop
Thread: Replacing text in Word

Replacing text in Word
CBenac 12/27/2008 12:05:01 AM
I've inherited an old application that creates a word document (Word 2003
and/or 2007) by opening a previously created document and replacing
information inside it, like in the example bellow:

.........
Attention of:
##vo_name
##vo_street
##vo_csz
We would like to thank you for........
..........

Can someone tell me what ##ho_name is? A tag, a bookmark? I couldn't figure
it out.

I need to rewrite the application using VBA. I already know how to create
the document but no idea on how to replace the "tags", assuming that is what
it is.

TIA
--
CBenac
Re: Replacing text in Word
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 12/27/2008 9:33:31 AM
I would think it is a custom tag. I say custom, because it is not native to
Word. From where does the data come that is inserted into the document in
place of those tags?

I would suggest that a userform is probably what you should be using.

See the following pages of fellow MVP Greg Maxey's website:

http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"CBenac" <CBenac[ at ]discussions.microsoft.com> wrote in message
news:BC5F9048-9D66-4B6B-A3A2-9558F7ED7EE3[ at ]microsoft.com...
[Quoted Text]
> I've inherited an old application that creates a word document (Word 2003
> and/or 2007) by opening a previously created document and replacing
> information inside it, like in the example bellow:
>
> ........
> Attention of:
> ##vo_name
> ##vo_street
> ##vo_csz
> We would like to thank you for........
> .........
>
> Can someone tell me what ##ho_name is? A tag, a bookmark? I couldn't
> figure
> it out.
>
> I need to rewrite the application using VBA. I already know how to create
> the document but no idea on how to replace the "tags", assuming that is
> what
> it is.
>
> TIA
> --
> CBenac


Home | Search | Terms | Imprint
Newsgroups Reader