View Single Post
  #1  
Old June 30th 09, 01:32 PM posted to microsoft.public.outlook.program_vba
Jeroen
external usenet poster
 
Posts: 14
Default Outlook 2007 crashed when pushing send on a displayed mailitem

Hello,

I have the following problem:

When I display a mailitem and push send Outlook 2007 crashed with no error.
It only happens when Outlook is not started when I execute my code.

It happens on different computers. SP2 is installed.

I use the following code:

var
Outlook : OLEVariant;
MailItem : OleVariant;
MAPI : OleVariant;
Folder : OleVariant;
begin
try
Outlook:=GetActiveOleObject('Outlook.Application') ;
except
Outlook:=CreateOleObject('Outlook.Application') ;
end;

MAPI := Outlook.GetNameSpace('MAPI');
Folder := MAPI.GetDefaultFolder(olFolderOutbox);
MailItem := Folder.Items.Add(olMailItem);

begin
try
MailItem.To := ';
MailItem.Display(false);
except
end;
end; {with}



Ads