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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USING OLE SPELL CHECK IN FORMS 2

Status
Not open for further replies.

goldenlam

MIS
Feb 28, 2000
12
US
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]
 
First of all thanks for putting OLE spell checker syntax.

How can I close the opened word document without saving?

I used 'FileExit' and it prompts a dialog box and waiting for a user input (Save,Quit or Cancel). Is there a method to ass 'Quit' as a parameter.
 
If you have not got a solution for the close without saving question,
you can add these lines before the:
--Release the OLE object
OLE2.RELEASE_OBJ(application);
section towards the end of the code.

args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 2);
OLE2.INVOKE (application, 'FileQuit', args);
OLE2.DESTROY_ARGLIST(args);
 
Hi!

Can anyone help me?
I would exchange data between Oracle Forms 6 and Ms Word 2000.
First I would like putting data into Word template and after saving document, reading data from it and inserting into Oracle DB. The Word template must be locked during writing into it.
I prefer using OLE2 rather then DDE.

Thanks in advance

 
Hi !

This works:

args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( args, 2 ); --> 2 = doNotSaveDoc
OLE2.INVOKE( l_app, 'FileClose', args );
OLE2.DESTROY_ARGLIST( args );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top