BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Stopping Outlook Termination

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX)
View previous topic :: View next topic  
Author Message
Murray Clarke
Guest





PostPosted: Tue Apr 24, 2007 5:13 pm    Post subject: Stopping Outlook Termination Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.