![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]()
You need to start with the myNameSpace.Folders collection. This will contain the root folders of all the information stores visible in the folder list, including the user's own mailbox (i.e. inbox.Parent), the Public Folders hierarchy, any .pst files, and any secondary mailboxes. Each MAPIFolder object in that collection will have its own Folders collection for you to iterate.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Rog" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to share folders w/ Outlook and Exchange between users | Nicolas Macarez | Outlook - General Queries | 7 | March 30th 06 05:11 PM |
What happens if multiple users update a contact stored in public folders? | [email protected] | Outlook - Using Forms | 1 | March 30th 06 03:18 PM |
delete names from "other users folders" drop down in outlook | Yonda | Outlook - Calandaring | 1 | March 28th 06 04:18 AM |
how do i share sub contact folders with other outlook users? | Rob | Outlook - Using Contacts | 1 | February 20th 06 10:26 PM |
Listing all data files | [email protected] | Outlook and VBA | 2 | February 3rd 06 05:15 PM |