-
2
- #1
How do you get the OLE spell check to work in Forms? I am trying to invoke the spell checker Word Basic Macro ToolsSpelling as follows:
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;
[sig][/sig]
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;
[sig][/sig]