Solved

Using MS-Word Spell check API's in VB

Posted on 2004-03-25
2
463 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
Comment Utility
try this tool which i am using:
http://www.tachyon-labs.com/tspell/
0
 
LVL 2

Accepted Solution

by:
dmenard earned 250 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

762 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

11 Experts available now in Live!

Get 1:1 Help Now