The help page on Store object says you should check using IsOpen before accessing a store. Try that.
Your simple code works just fine for me.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, Triying to use a macro in a shared store in Outlook, I received this error:
"Run-time error '-1698234242 (9ac7007e)' Automation Error.
Then I did a "test" for Check the available stores in my Inbox but stopped in "Next oStore" and I receive this error (similar to the previous):
Run-time error -941162370 (c7e7007e) Automation Error.
Sub Test()
Dim myNameSpace As Outlook.NameSpace
Dim oStore As Outlook.Store
Set myNameSpace = Application.GetNamespace("MAPI")
For Each oStore In myNameSpace.Stores
Debug.Print oStore.DisplayName
Next oStore
End Sub
I don't know where is the problem... I already have Stores in my Inbox. The error is not in the code. Someone for helping me? Thanks in advance.
The help page on Store object says you should check using IsOpen before accessing a store. Try that.
Your simple code works just fine for me.