|
-
Aug 22nd, 2000, 08:48 AM
#1
Thread Starter
Lively Member
Anybody know how to open a word document, find & replace, then save (in same format) from vb5>???
-
Aug 22nd, 2000, 09:04 AM
#2
Member
You need to add the Microsoft Word object library as a reference to your project.
to envoke an instance of Word:
dim wdApp as Word.Application
dim wdDoc as Word.Document
set wdApp = New Word.Application
set wdApp = New Word.Document
You can then control word via your VB app in a similar manner to that of macro-generated code. If you wish to to a find and replace type of command, record a macro to do it, examine the code, and this can be used (more or less) within your defined app/doc objects.
When your done, make sure vb does a
wdDoc.Close
wdApp.Quit
to close word down poperly.
-
Aug 22nd, 2000, 09:45 AM
#3
Lively Member
-
Aug 22nd, 2000, 10:13 AM
#4
Member
correction to my original post
I meant to say:
set wdApp=New Word.Application
set wdDoc=wdApp.Documents.Add
just testing......
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|