R
Rog
Need help listing another users folders
Folks I need help with this.
We have a mailbox that's used to receive helpdesk-like requests. Several
people attach to it by adding the Exchange entry to their email setup.
I need to write a simple script to write the list of folders under a
top-level folder to a file.
I’ve written a script that writes my folders to a file just fine, and I have
tried using GetSharedDefaultFolder to get the default Inbox of the helpdesk
account, but I’m stuck.
The code is blowing up at the “Set MyCollection†line. The problem may be
that the top-level folder is at the same level as the Inbox, not under it.
Ideally I would like to run this as VBScript from outside of Outlook, but
I’ll consider other options.
Any and all help will be greatly appreciated!
My code so far:
Set Application = CreateObject("Outlook.Application")
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient("helpdesk-accnt")
myRecipient.Resolve
Set InboxFolder = myNameSpace.GetSharedDefaultFolder(myRecipient, 6)
Set MyCollection = InboxFolder.Folders("Top Level Task, Items, Problems")
For I = 1 to MyCollection.Count
set MyFolder = myCollection.Item(i)
MsgBox MyFolder.Name, vbInformation
Next
Folks I need help with this.
We have a mailbox that's used to receive helpdesk-like requests. Several
people attach to it by adding the Exchange entry to their email setup.
I need to write a simple script to write the list of folders under a
top-level folder to a file.
I’ve written a script that writes my folders to a file just fine, and I have
tried using GetSharedDefaultFolder to get the default Inbox of the helpdesk
account, but I’m stuck.
The code is blowing up at the “Set MyCollection†line. The problem may be
that the top-level folder is at the same level as the Inbox, not under it.
Ideally I would like to run this as VBScript from outside of Outlook, but
I’ll consider other options.
Any and all help will be greatly appreciated!
My code so far:
Set Application = CreateObject("Outlook.Application")
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient("helpdesk-accnt")
myRecipient.Resolve
Set InboxFolder = myNameSpace.GetSharedDefaultFolder(myRecipient, 6)
Set MyCollection = InboxFolder.Folders("Top Level Task, Items, Problems")
For I = 1 to MyCollection.Count
set MyFolder = myCollection.Item(i)
MsgBox MyFolder.Name, vbInformation
Next