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!

Attaching Document to Lotus Notes E-mail using OLE2

Status
Not open for further replies.

krindler

Programmer
Jul 16, 2002
39
US
Hello...

I want to send an e-mail, with an attachment, from Forms using OLE2. I can get the e-mail to send fine (I have shown the code below), but am having trouble trying to figure out how to attach a document to the e-mail. Can anyone give me some help in adding an attachment to the code below?

args OLE2.LIST_TYPE;
db OLE2.OBJ_TYPE;
doc OLE2.OBJ_TYPE;
session OLE2.OBJ_TYPE;

BEGIN

session := OLE2.CREATE_OBJ ( 'Notes.NotesSession' );
args := OLE2.CREATE_ARGLIST;

OLE2.ADD_ARG ( args, ' ' );
OLE2.ADD_ARG ( args, 'names.nsf' );
db := OLE2.INVOKE_OBJ ( session, 'GetDatabase', args );
OLE2.DESTROY_ARGLIST ( args );

doc := OLE2.INVOKE_OBJ ( db, 'CreateDocument' );
OLE2.SET_PROPERTY(doc,'SendTo','test.user@comp.com');
OLE2.SET_PROPERTY(doc,'SendTo','test.mgr@comp.com');
OLE2.SET_PROPERTY(doc,'Subject','Month End Report' );
OLE2.SET_PROPERTY(doc,'Body','Your Month End Report');

args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG ( args, 0 );
OLE2.INVOKE ( doc, 'Send', args );
OLE2.DESTROY_ARGLIST ( args );

END;

OLE2.RELEASE_OBJ ( session );
OLE2.RELEASE_OBJ ( db );
OLE2.RELEASE_OBJ ( doc );

Thanks In Advance for your help!!




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top