Solved

Search A  ".doc "??

Posted on 2002-05-22
4
134 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Input past end of file vbs script 9 91
Visual Basic Excel Formatting error 4 102
Access 2013 combo box not working 3 43
VB6 ListBox Question 4 42
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

806 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