Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

spell check with word

Status
Not open for further replies.

gooracle

Programmer
Jul 20, 2001
1
US
Entire code is pasted at the bottom:

Used this sort of code in forms to do spell check
in word. code is working fine only for the first time
or if(and only when) a constant is declared in declare section say,

declare
sel_text varchar2(2000) := 'this is oracle';

and if this sel_text is passed to an argument list,
it works all the time. and for all other instances, it doesn't do anything basically if

sel_text := :block.item;

and is sent as an argument. simply ignores it (and sometimes, this is also working, and if form is rerun
for the second time it doesn't do anything). operating system is win 95. it's not producing any consistent erroneous behaviour. Any help?





DECLARE

-- Declare the OLE object
application OLE2.OBJ_TYPE;

-- Declare handle to the OLE argument list
args OLE2.LIST_TYPE;

-- Declare a temporary local variable for returned text
sel_text VARCHAR2(1000);

BEGIN

-- Start WordBasic
application:=OLE2.CREATE_OBJ('Word.Basic');

-- Create a temporary document to do the spell check in
OLE2.INVOKE(application, 'FileNew');

-- Insert the text of field CONTROL.LONGFIELD into temporary document
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, :SAMPLE_CTL.TXT_COMMENT);
OLE2.INVOKE(application, 'Insert', args);
OLE2.DESTROY_ARGLIST(args);

-- Invoke the spell checker
OLE2.INVOKE(application, 'ToolsSpelling');

-- Return corrected text to Oracle Forms
OLE2.INVOKE(application, 'EditSelectAll');
sel_text:=OLE2.GET_CHAR_PROPERTY(application, 'Selection');


MESSAGE(sel_text);
MESSAGE(sel_text);

--Release the OLE object
OLE2.RELEASE_OBJ(application);

-- The text brought back contains an extraneous control character
-- (a paragraph marker) so get rid of it
:SAMPLE_CTL.TXT_COMMENT:=SUBSTR(sel_text, 1, (LENGTH(sel_text)-1) );

END;
 
Hi,

Spell check can be done still easier using system_editor ,

Please look for the help on system_editor.

Regards
Nagendra P
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top