Jeremy
Guest
|
I am writing a Windows service utilizing Outlook and the Outlook Security Manager.
When I start the service, I disable Outlook Security and send an email. I then re-enable Outlook Security, release my COM objects and free variables in my Finally block.
The next time the service processes the Sub, I am able to create the new Outlook object and connect to it using the ConnectTo method of the Outlook Security object, but when I attempt to call the Check method it fails with an error:
Unspecified error
at AddinExpress.Outlook.IOutlookSecurityManager.Check(Int32 apiType)
at AddinExpress.Outlook.SecurityManager.Check(osmWarningKind kind)
A very similar error is thrown if I attempt to DisableOOMWarnings without the Check call:
Unspecified error
at AddinExpress.Outlook.IOutlookSecurityManager.Check(Int32 apiType)
at AddinExpress.Outlook.SecurityManager.set_DisableOOMWarnings(Boolean value)
I create the Outlook Security Manager object using:
Dim SecMan As New AddinExpress.Outlook.SecurityManager
I free the Outlook Security Manager object in the Finally block using:
SecMan.DisableOOMWarnings = False
SecMan.Dispose()
SecMan = Nothing
'Iterate through Outlook objects using code such as:
If Not IsNothing(oOutlook) Then
oOutlook.Quit()
While (System.Runtime.InteropServices.Marshal.ReleaseComObject(oOutlook) > 0)
End While
oOutlook = Nothing
End If
'Call Garbage Collection:
GC.Collect()
GC.WaitForPendingFinalizers()
'Sleep recommended by a MS KB article
System.Threading.Thread.Sleep(5000)
I have searched your forum and documentation for a different or recommended way to free the Outlook Security Manager object, but have not found any information. Any ideas what could be causing this error? I can attach or post any additional code as necessary. Thank you for your help.
Sincerely,
Jeremy |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Jeremy.
Now we are looking for the cause of the error. Your code would be very useful for us. Could you send us your project?
Besides, did you read this article: http://support.microsoft.com/?kbid=237913. |
|
Guest
Guest
|
Yes I will gladly send you the project files. It is a Proof of Concept program taken from my original for simplicity.
Unfortunately I am familiar with that KB article. However, we are attempting to automate several Outlook features that I have been unable to do otherwise.
Thank you for your reply,
Jeremy |
|
Eugene Starostin
Guest
|
Hello Jeremy,
Have you tested our sample project? |
|
Jeremy
Guest
|
I have used the files you sent with great success! Thank you so much for the fast response and fix. You have a great product! It is nice to work with such an effective and responsive company.
Jeremy |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Jeremy.
Thanks a lot for your good words. |
|