A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Need help listing another users folders



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 17th 06, 08:43 PM posted to microsoft.public.outlook.program_vba
Rog
external usenet poster
 
Posts: 6
Default Need help listing another users folders

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  
Old July 19th 06, 10:21 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Need help listing another users folders

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 07:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright 2004-2025 Outlook Banter.
The comments are property of their posters.