Discussion:
Outlook 2007 crashed when sending a mailtem shown with Display
(too old to reply)
Jron667
2009-06-25 10:28:20 UTC
Permalink
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;
Jron667
2009-06-25 11:13:34 UTC
Permalink
Post by Jron667
Hello,
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
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;
  end; {with}
  Outlook := Unassigned;
end;
MailITem.To has to be under the MailITem.Display command.
Jron667
2009-06-28 10:01:34 UTC
Permalink
Post by Jron667
Post by Jron667
Hello,
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
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;
  end; {with}
  Outlook := Unassigned;
end;
MailITem.To has to be under the MailITem.Display command.
It only happens when Outlook has not been started.
LesDix
2009-08-10 13:07:01 UTC
Permalink
Jron667, Did you ever get to the bottom of this? I have encountered the same
problem.
Post by Jron667
Post by Jron667
Post by Jron667
Hello,
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
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;
end; {with}
Outlook := Unassigned;
end;
MailITem.To has to be under the MailITem.Display command.
It only happens when Outlook has not been started.
Loading...