Const olNotExchange = 3
Dim olkApp, olkSes, olkSto, intIndex
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
olkSes.Logon olkApp.DefaultProfileName
For intIndex = olkSes.Stores.count To 1 Step -1
Set olkSto = olkSes.Stores.Item(intIndex)
If olkSto.ExchangeStoreType = olNotExchange Then
olkSes.RemoveStore olkSto.GetRootFolder
End If
Next
olkSes.Logoff
olkApp.Quit
Set olkSto = Nothing
Set olkSes = Nothing
Set olkApp = Nothing
|