Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Webutil error while using Outlook

sriram_aFeb 6 2006 — edited Feb 6 2006
Hi..
Iam trying to send a mail from my form (forms 10G).
I can actually able to send the mail from the form but i also get an error like this.

"WUO-705: Unable to invoke method: Send; Exception
com.jacob.com.ComFailException:
VariantChangeType Failed"

This is the code i used:

PROCEDURE send_word_req IS
v_to varchar2(100) ;
v_cc VARCHAR2(100);
v_bcc VARCHAR2(1);
v_subject varchar2(100) := 'Test mail from Form Using Client_OLE2';
v_body varchar2(100) := 'Hi...This mail is to test sending a mail from Forms using webutil. ';
OutlookApp client_ole2.OBJ_TYPE;
NameSpace client_ole2.OBJ_TYPE;
Folders client_ole2.OBJ_TYPE;
MailItem client_ole2.OBJ_TYPE;
OLEPARAM client_ole2.list_type;
Send client_ole2.OBJ_TYPE;
Attachments client_ole2.OBJ_TYPE;
Attachment_dummy client_ole2.OBJ_TYPE;

begin
OutlookApp := client_ole2.CREATE_OBJ('Outlook.Application');
v_to := 'xyz@yahoo.com';
-- Create a namespace
-- Think of this as the equivalent as the Documents Collection
OLEPARAM := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := client_ole2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
client_ole2.DESTROY_ARGLIST( OLEPARAM );
--Create a newMail Object
OLEPARAM := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(OLEPARAM,0);
MailItem := client_ole2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
client_ole2.DESTROY_ARGLIST( OLEPARAM );
client_ole2.set_property(MailItem,'To',v_to);
client_ole2.set_property(MailItem,'Subject',v_subject);
client_ole2.set_property(MailItem,'Body',v_body);

Send := client_ole2.INVOKE_OBJ(Mailitem,'Send');

client_ole2.RELEASE_OBJ( MailItem);
client_ole2.RELEASE_OBJ( NameSpace );
client_ole2.RELEASE_OBJ( OutlookApp );
Message('Mail send successfully...');

END;


Plz help me in this regard.

Thanx in advance
Sriram
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2006
Added on Feb 6 2006
1 comment
406 views