 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Murray Clarke Guest
|
Posted: Tue Apr 24, 2007 5:13 pm Post subject: Stopping Outlook Termination |
|
|
I have a small BCB6 application which makes a connection to Microsoft Outlook (already running) and then sends an email. When I close my application, Outlook also closes even though I do not call the Disconnect or Quit functions.
How can I close my application and leave Outlook running?
Interestingly, I wrote a small test program in Delphi6 and I do not experience the problem.
Indicative code is:
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
OutlookApplication1 = new TOutlookApplication(this);
OutlookApplication1->ConnectKind = ckRunningOrNew;
OutlookApplication1->Connect();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
NameSpace = OutlookApplication1->GetNamespace((WideString)"MAPI");
NameSpace->Logon((TVariant)"", (TVariant)"", (TVariant)false, (TVariant)false);
MailItemPtr MailItem1 = (MailItemPtr)(OutlookApplication1->CreateItem(olMailItem));
MailItem1->set_To((WideString)"murray.clarke (AT) yahoo (DOT) com.au");
MailItem1->set_Subject((WideString)"Test Message");
MailItem1->Send();
NameSpace->Logoff();
}
Any help to solve this annoying problem would be appreciated.
Regards
Murray |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|