A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook 2007 crashed when pushing send on a displayed mailitem



 
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old July 1st 09, 04:06 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

Problem solved by starting Outlook with a ShellExecute and then ask the
handle for the COM object. Somehow starting Outlook through com causes the
exceptio mentioned earlier.

"Jeroen" wrote:

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}



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory with MailItem.Send Nathan Outlook and VBA 1 June 25th 09 05:24 PM
my outlook 2007 crashed and now won't let me remove and reinstall. Oddysey1 Outlook - Installation 1 June 21st 09 01:27 AM
Exception thrown on MailItem.Send bstrum Add-ins for Outlook 3 June 5th 07 04:54 PM
Outlook 2007 beta crashed Outlook 2003 jpegjim Outlook - Installation 2 February 22nd 07 07:11 PM
Losing handle to MailItem when send donald Add-ins for Outlook 8 February 1st 06 07:09 PM


All times are GMT +1. The time now is 08:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.