SecurityManager.ConnectTo is launching Outlook window

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

SecurityManager.ConnectTo is launching Outlook window
 
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Charlie,

I've found these problems:

1. You pass oInspector to the ConnectTo method. Ok. But you pass objOutlook to the Disconnect method. Not okay.
2. I've added Option Explicit to that form and found that objOutlook and g_objItems are undeclared.

Does fixing the above solve the original issue?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Nov, 2012 04:50:14 Top
charliehomo




Posts: 15
Joined: 2012-11-15
Hello Andrei,

I cleaned things up and posted new code for you. Same issue with Outlook instance not being cleaned up after disconnecting.

Let me know what you think.

Regards,

Charlie
Posted 27 Nov, 2012 11:38:45 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Charlie,

You need to close that inspector before setting it to Nothing:

...
    Me.lblContactCount = i & " contacts in " & ElapsedTime(lTemp) & " seconds"
        
Call oInspector.Close(olDiscard)
        
    Set oItem = Nothing
    Set oInspector = Nothing
    Set objItems = Nothing
    
    Exit Sub
...


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Nov, 2012 11:11:15 Top
charliehomo




Posts: 15
Joined: 2012-11-15
Hi Andrei,

This worked beautifully, thank you!

Charlie
Posted 29 Nov, 2012 15:43:19 Top