![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |