Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Add signature to Outlook-Email using OLE



Permlink Replies: 0 Threads: [ Previous | Next ]
Markus Theodoru...

Posts: 1
Registered: 11/21/16
Add signature to Outlook-Email using OLE
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 17, 2018 3:15 AM
Hi there,

I am creating an E-Mail in Outlook using OLE. Is it possible Outlook adds my standard signature to the generated E-Mail?

My Code:

Variant Outlook, EMailMessage;

// Start Outlook
// =============
Outlook = CreateOleObject( "Outlook.Application" );

// Create an new E-mail
//
EMailMessage = Outlook.OleFunction( "CreateItem", (Variant)0 );

EMailMessage.OlePropertySet( "TO", (Variant)(WideString(Edit1->Text.c_str()).c_bstr()) );
EMailMessage.OlePropertySet( "CC", (Variant)(WideString(Edit2->Text.c_str()).c_bstr()) );
EMailMessage.OlePropertySet( "Subject", (WideString(Edit3->Text.c_str()).c_bstr()) );
EMailMessage.OlePropertySet( "HTMLBody", (WideString(Memo1->Text.c_str()).c_bstr()) );

EMailMessage.OleFunction( "Display" );

EMailMessage.OleFunction( "Send");

// Close Outlook
// =============
Outlook.OleFunction( "Quit" );
Outlook.Clear();
Outlook = Unassigned;
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02