GetSharedDefaultFolder - Outlook stays in memory

M

Markus Kraemer

Hi,

I'am writing a c# CommAddin using GetSharedDefaultFolder to access
calendar folders from several users. The problem is, that outlook will
not shut down properly, if a calendar of a certain user is accessed.

Yes, it's true. It seems to depend on the users mailbox, because the code works
fine for nearly all users, except a few. Maybe the problem can be solved
doing something in exchange. I tried everthing I can imagine with no
result. In order to test it and to exclude any c#-problems I've written
some vbs-code (see below). I keep in mind to set any COM-instances of
Outlook objects to Nothing.

Any help is welcome.

Markus

========================================================================
Dim oApp
Dim oNS
Dim oRep
Dim oFolder
Dim cPostfach

Set oApp = CreateObject("Outlook.Application")
Set oNS = oApp.GetNamespace("MAPI")
oNS.Logon "", "", False, True
'cUser = "User 1" ' Outlook stays in memory
cUser = "User 2" ' everthing is fine
Set oRep = oNS.CreateRecipient(cUser)
oRep.Resolve
If oRep.Resolved Then
Set oFolder = oNS.GetSharedDefaultFolder(oRep, 9) 'olFolderCalendar
MsgBox "Folder " + oFolder.Name + " for " + cUser + " found"
End If

oNS.LogOff

Set oFolder = Nothing
Set oRep = Nothing
Set oNS = Nothing
Set oApp = Nothing
========================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top