DECLARE
application OLE2.OBJ_TYPE;
sel_text VARCHAR2(1000);
args ole2.list_type; 
check_file text_io.file_type;
no_file EXCEPTION;al_id Alert;
al_button Number;BEGINal_id := Find_Alert('MY_ALERT');BEGIN
check_file := TEXT_IO.FOPEN('C:\test1.doc','R');
TEXT_IO.FCLOSE(check_file);
EXCEPTION
WHEN OTHERS THEN
Set_Alert_Property(al_id, alert_message_text, sqlcode || ', '||sqlerrm||'. No Files found.' );
al_button := Show_Alert( al_id );
RAISE no_file;
END; 
application := OLE2.CREATE_OBJ('word.basic');
ole2.invoke(application,'Appshow');args := ole2.create_arglist;
-- ole2.add_arg(args,'C:\test2.rtf');
ole2.add_arg(args,'C:\test1.doc');ole2.invoke(application,'FileOpen',args);
ole2.destroy_arglist(args);OLE2.INVOKE(application, 'EditSelectAll');
sel_text:=OLE2.GET_CHAR_PROPERTY(application, 'Selection');OLE2.INVOKE(application, 'FileClose'); 
OLE2.INVOKE(application, 'FileExit'); 
OLE2.RELEASE_OBJ(application);Set_Alert_Property(al_id, alert_message_text, 'sel_text = '||sel_text );
al_button := Show_Alert( al_id );END;