Add an attachment to an Outlook email generated by Oracle Form 6i [message #100607] |
Wed, 05 March 2003 13:10 |
Chris Kaelin
Messages: 2 Registered: March 2003
|
Junior Member |
|
|
Here is the basic code to generate an email message in outlook tha was sent to me by someone on the ODTUG mail list. This work as is with no probelms. I need to be able to add an attachement before sending the email. Does anyone have any ideas?
PROCEDURE OUTLOOK_EMAIL IS
v_to VARCHAR2(50) := 'CKAELIN@AFIT.EDU';
v_sub VARCHAR2(50) := 'Test EMail 1';
v_cc VARCHAR2(50);
v_body VARCHAR2(2000);
hApplication OLEOBJ;
hMailItem OLEOBJ;
BEGIN
v_body := 'This is a test message';
hApplication := CREATE_OLEOBJ('Outlook.Application',TRUE);
INIT_OLEARGS(1);
ADD_OLEARG(0);
hMailItem := CALL_OLE_OBJ(hApplication, GET_OLE_MEMBERID(hApplication,'CreateItem'));
SET_OLE(hMailItem,GET_OLE_MEMBERID(hMailItem,'To'),v_to);
IF v_cc IS NOT NULL THEN
SET_OLE(hMailItem,GET_OLE_MEMBERID(hMailItem,'CC'),v_cc);
END IF;
SET_OLE(hMailItem,GET_OLE_MEMBERID(hMailItem,'Subject'),v_sub||'-'||course_rec.full_name);
SET_OLE(hMailItem,GET_OLE_MEMBERID(hMailItem,'body'),v_body);
CALL_OLE(hMailItem, GET_OLE_MEMBERID(hMailItem,'Display'));
INIT_OLEARGS(0);
-- Un-Comment these to automatically send the email
CALL_OLE(hMailItem, GET_OLE_MEMBERID(hMailItem,'Save'));
CALL_OLE(hMailItem, GET_OLE_MEMBERID(hMailItem,'Send'));
END;
|
|
|