Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE integration with Microsoft Word using VB 6.0

Status
Not open for further replies.

cj92713696

Programmer
Nov 23, 2000
105
US
Hello everyone,

I'm relatively new to OLE programming and I have a question for you gurus! =)

I'm trying to write a Visual Basic 6.0 application that replaces script variables from an existing Word document with another value and saves the document as a filename other than the existing template.

Thus far ...

I have already created my Word document inserting an opening &quot;<&quot;, than a variable name I create, with a closing &quot;>&quot;. I need my Visual Basic app. to replace the variable with different text.

Here's an example ...

---
Dear <customer>,

Annual profits are not in accordance ...
---

I'd like to use a replace command if it exists, but I have not had any luck finding it. Just to replace all occurences of <customer> with something else.

Your help is very much appreciated!

Thanks,
CJ
 
You can programmatically create and edit Word documents from VB by making a reference to the Word Object Library. Look in Project References.
 
I have already instantiated the Word object, but do not know the command to replace.

CJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top