Board index » delphi » OUTLOOK: After presssing the SEND button, the mail form doesn't close the window...

OUTLOOK: After presssing the SEND button, the mail form doesn't close the window...


2005-03-11 05:17:22 AM
delphi227
Hello folks:
i did this
form8.OutlookMail := form8.Outlook.CreateItem(olMailItem) as
MailItem;
form8.OutlookMail.To_ := mymailaddress
form8.OutlookMail.Attachments.Add( TheFile ,EmptyParam,
EmptyParam, EmptyParam);
form8.OutlookMail.Display( true );
all this works fine, but when pressing the SEND button, the mail is sent,
and it DOES NOT CLOSE close the mail window, and this windows remains
freezed?
Thanks folks
Pablo Romero , Cordoba Argentina
 
 

Re:OUTLOOK: After presssing the SEND button, the mail form doesn't close the window...

Quote
all this works fine, but when pressing the SEND button, the mail is sent,
and it DOES NOT CLOSE close the mail window, and this windows remains
freezed?
Are you doing any cleanup? This code works great for me:
oOutlook : OleVariant;
oEMail : Variant;
// * Launch/Open Outlook
try
oOutlook := GetActiveOleObject('Outlook.Application') ;
except
oOutlook := CreateOleObject('Outlook.Application') ;
end;
// * Create a mail item
oEMail := oOutlook.CreateItem(0);
// * Attach the file
oEMail.Attachments.Add(strDestination);
// * Show the message
oEMail.Display;
end;
// * Clean up. Note that we can do this while the message is
still
// * displayed
if NOT(VarIsEmpty(oOutlook)) then
oOutlook := Unassigned;
if NOT(VarIsEmpty(oEMail)) then
oEMail := Unassigned;
 

Re:OUTLOOK: After presssing the SEND button, the mail form doesn't close the window...

Does it work if you call Display(false)?
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Pablo Romero" <XXXX@XXXXX.COM>writes
Quote
Hello folks:

i did this

form8.OutlookMail := form8.Outlook.CreateItem(olMailItem) as
MailItem;
form8.OutlookMail.To_ := mymailaddress
form8.OutlookMail.Attachments.Add( TheFile ,EmptyParam,
EmptyParam, EmptyParam);
form8.OutlookMail.Display( true );

all this works fine, but when pressing the SEND button, the mail is sent,
and it DOES NOT CLOSE close the mail window, and this windows remains
freezed?

Thanks folks

Pablo Romero , Cordoba Argentina



 

Re:OUTLOOK: After presssing the SEND button, the mail form doesn't close the window...

No my friend. it does not work. With outlook 2000, works fine. Not with
outlook 2003
"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
Quote
Does it work if you call Display(false)?

Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Pablo Romero" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Hello folks:
>
>i did this
>
>form8.OutlookMail := form8.Outlook.CreateItem(olMailItem) as
>MailItem;
>form8.OutlookMail.To_ := mymailaddress
>form8.OutlookMail.Attachments.Add( TheFile ,EmptyParam,
>EmptyParam, EmptyParam);
>form8.OutlookMail.Display( true );
>
>all this works fine, but when pressing the SEND button, the mail is
sent,
>and it DOES NOT CLOSE close the mail window, and this windows remains
>freezed?
>
>Thanks folks
>
>Pablo Romero , Cordoba Argentina
>
>
>