Jron667
2009-06-25 10:28:20 UTC
Hello,
I have the following problem:
When I make an e-mail programmatically and Display it, Outlook 2007
crashes when I push the Send button. When i directly Send the e-mail
it works without any problems.
It only appears when Outlook 2007 is not started when creating the
mailitem.
I disabled all my addins, did not work.
I'm not the only one having this problem, a collegue of mine has the
same problem.
It does not matter if I use VBA or Redemption to create the e-mail.
Now i'm using a simple application to solve the error which uses the
following code:
const olMailItem = 0;
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.Display;
except
end;
MailItem.To := '***@home.nl';
end; {with}
Outlook := Unassigned;
end;
I have the following problem:
When I make an e-mail programmatically and Display it, Outlook 2007
crashes when I push the Send button. When i directly Send the e-mail
it works without any problems.
It only appears when Outlook 2007 is not started when creating the
mailitem.
I disabled all my addins, did not work.
I'm not the only one having this problem, a collegue of mine has the
same problem.
It does not matter if I use VBA or Redemption to create the e-mail.
Now i'm using a simple application to solve the error which uses the
following code:
const olMailItem = 0;
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.Display;
except
end;
MailItem.To := '***@home.nl';
end; {with}
Outlook := Unassigned;
end;