Solved

Using MS-Word Spell check API's in VB

Posted on 2004-03-25
2
466 Views
Last Modified: 2013-12-26
I have an array of 6 English words. Out of these words some are not spelt properly. While going through this array in a "for loop", I need to write each correctly spelt word into a file (.txt or .doc). If a word is incorrectly spelt then I should not write it in the file.
Should I be using some Word-API to achieve the task? If yes, can you please let me know how to do this? (I have MS Word-2002 installed in my system.)

E.g.
Dollar
Doller
Dallor
Paund
Pound

Now while reading this array only Dollar and Pound should be written out in the file (.txt or .doc).
0
Comment
Question by:subo75
2 Comments
 
LVL 3

Expert Comment

by:pg_india
ID: 10685672
try this tool which i am using:
http://www.tachyon-labs.com/tspell/
0
 
LVL 2

Accepted Solution

by:
dmenard earned 250 total points
ID: 10686152
Some pseudo code (from my memory) which can help :

' Launch word
Set WordApplication = CreateObject("Word.Application")

' for debugging : let the word window be visible
WordApplication.Visible=true

' Create a new blank document
Set WordDocument = WordApplication.Documents.Add()

' check a word (repeat for each word)
for ...
   WordDocument.Content.Text = h
   if    WordDocument.SpellingErrors.count=0 then
      ' the word is OK
   else
      ' the word is misspelled
   end if
   WordDocument.Content.Delete
next

' when all the word are checked, close word
   WordDocument.Close false
   Set WordDocument=nothing
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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

785 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