outlook 2003, security manager 2009, error on outlookapp.createitem

Add-in Express™ Support Service
That's what is more important than anything else

outlook 2003, security manager 2009, error on outlookapp.createitem
 
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.
Posted 06 Jan, 2010 05:39:21 Top
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.
Posted 06 Jan, 2010 06:24:25 Top
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?
Posted 08 Jan, 2010 08:26:36 Top