Darin Horton
Posts: 6
Joined: 2010-01-06
|
My code:
Dim OutlookApp As New Outlook.Application
Dim newMail As Outlook.MailItem = Nothing
Dim recipient As Outlook.Recipient = Nothing
Dim recipients As Outlook.Recipients = Nothing
Dim canQuit As Boolean
Dim securityManager As New AddinExpress.Outlook.SecurityManager
If Not OutlookApp Is Nothing Then
canQuit = True
If Not OutlookApp Is Nothing Then
canQuit = False
End If
If Not OutlookApp Is Nothing Then
Try
securityManager.ConnectTo(OutlookApp)
securityManager.DisableOOMWarnings = True
newMail = OutlookApp.CreateItem(Outlook.OlItemType.olMailItem)
********* more code
Catch oExcept1 As Exception
ShowMessage(oExcept1.Message, "oExcept1")
On the last line (newmail=oulookapp.createitem), i receive the message (from the Catch block):
"The operation failed"
This happens when outlook 2003 is opened or closed. |
|
Darin Horton
Posts: 6
Joined: 2010-01-06
|
More info:
Dim OutlookApp As New Outlook.Application
Dim newMail As Outlook.MailItem = Nothing
Dim recipient As Outlook.Recipient = Nothing
Dim recipients As Outlook.Recipients = Nothing
Dim canQuit As Boolean = True
Dim securityManager As New AddinExpress.Outlook.SecurityManager
If Not OutlookApp Is Nothing Then
canQuit = False
Try
securityManager.ConnectTo(OutlookApp)
securityManager.DisableOOMWarnings = True
newMail = OutlookApp.CreateItem(Outlook.OlItemType.olMailItem)
If Not newMail Is Nothing Then
Sometimes (outlook 2003 open), on the line:
securitymanager.disableoomwarnings=true
i receive:
error hresult e_fail has been returned from a call to a COM component. |
|
Eugene Astafiev
Guest
|
Hello Darin,
Please try removing the following lines of code:
securityManager.ConnectTo(OutlookApp)
securityManager.DisableOOMWarnings = True
BTW Do you develop a COM add-in or a standalone application? |
|