Opening MSword document with VB4.0/VB5.0 
Author Message
 Opening MSword document with VB4.0/VB5.0

Is there some one that can help me with the following problem.

I want to open a MsWord file and scan the file for the words in it. Because
its not a pure ASCII file I have problems to read the words in the
If somebody have a solution pleas let me now

I'm using as program language VB 4.0 and/or VB 5.0


Wed, 10 May 2000 03:00:00 GMT  
 Opening MSword document with VB4.0/VB5.0

You'll need to get MS Words' file protocol in order to screen out formatting
codes.  That's no small task.  

However, individual words in Word, although surrounded by formatting code,
exist as their ASCI equivalents within the Word file.  Just open the file as
Binary, read in a good chunk of the file, scan it for the word you're looking
for using the InStr function, and you should be able to find it.  Then read in
the next part of the file (set the pointer back about 200 bytes to ensure that
any words clipped in the last read are thus read in the next Get statement) and
continue scanning.  
Be aware that any words with apsotrophes will not be found, since Word does not
use the simple ASCI apostrophe.  You will also not be able to find groups of
words this way, since all words in Word files are separated by formatting code
and not the simple ASCI 32 character.  Make sure you use InStr with the
"compare" argument set to 1 (not case sensitive).  You need to use the "start"
argument also when you do this.
Steve Pugliese

Fri, 12 May 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Open non-MSWORD file with MSWORD application

2. Trouble Opening a Word Document with VB.NET,Open member not found in Documents

3. Retrieving window coords of words in MSWord document

4. Creating command bar only in the current active document in MSWord

5. Creating command bar only in the current active document in MSWord

6. MSWord data mine from document with VB.NET

7. msword document and VB

8. creating MSWord document in asp

9. open MSword using Access basic

10. DOCS Open API and MSWord

11. DOCS Open API and MSWord

12. Cannot open asp file application/msword


Powered by phpBB® Forum Software