Consultor Eletrônico



Kbase 18266: ACTIVEX - How To Get Excel To Spell Check One Or More Words
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/02/2000
The following simple 4GL code shows how to use Microsoft Excel (the
Office 97 version) to tell you whether a word (or list of words) are
valid words or not.

The method we are using here simply returns true or false depending
on whether the word(s) you passed to it are valid words or not. The
method does not invoke any kind of dialog box that allows you to
correct the spelling.

DEFINE VARIABLE cWordList AS CHARACTER NO-UNDO FORMAT "X(50)".
DEFINE VARIABLE oExcel AS COM-HANDLE NO-UNDO.

UPDATE cWordList.

CREATE "Excel.Application" oExcel.

IF oExcel:CheckSpelling(cWordList) THEN
MESSAGE "Word Found" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Word Not Found" VIEW-AS ALERT-BOX.

RELEASE OBJECT oExcel.