Solved

Search A  ".doc "??

Posted on 2002-05-22
4
132 Views
Last Modified: 2010-05-02
Hi

In VB is it possible to search a word document against a list of key words and when matches ar efound disply them ???


Code would be great or tips ???
0
Comment
Question by:silki
  • 2
  • 2
4 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 130 total points
ID: 7026728
You can automate word:

dim w as object
dim d as object
set w = createobject ("Word.Application")
set d = w.Documents.Open ("c:\mydata\project.doc")

...

d.close false
set d = nothing
w.quit
set w = nothing

at the place ... you can do many things, including the .Find method of Word.

Note:
* if you check the 'Microsoft Word x.0' in the project references, you can use dim w as Word.Application etc instead, and can code much easier, but I don't use it because of binding problems for different version of word...

* If you know how to build macros with office, you can quite easily put in the good code for ...

CHeers

0
 

Author Comment

by:silki
ID: 7026836
Thanx

any code exsamples for thr find cud i would have to match aginst a LIST of WORDS ???
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7026853
You have to check each word in the list 1-by-1 ...
CHeers
0
 

Author Comment

by:silki
ID: 7026866
Thanx

any code exsamples for thr find cud i would have to match aginst a LIST of WORDS ???
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now