Outlook 2003 Script How to get a List of SubFolder

  • Thread starter Thread starter bbnimda
  • Start date Start date
B

bbnimda

Hi all,

How can I obtain à list of subfolder (contact) in Outlook Public Folder eg:
Business

Business
|__ Customer
|__ Provider
|__ Reseler
Private
|__Family
|__Frends


Thks
 
I didn't found the right function to use in my Form, can U help me

Thks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Each folder has a Folders collection containing its subfolders
 
Again, you need to start with the first folder you're interested in, and work with its Folders collection:

strList = ""
For Each objFolder in myFolder.Folders
strList = strList & objFolder.Name & vbCrLf
Next
MsgBox strList

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


bbnimda said:
I didn't found the right function to use in my Form, can U help me

Thks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Each folder has a Folders collection containing its subfolders
 
Tks Sue,

I'll try this immediatly

@+

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %[email protected]...
Again, you need to start with the first folder you're interested in, and
work with its Folders collection:

strList = ""
For Each objFolder in myFolder.Folders
strList = strList & objFolder.Name & vbCrLf
Next
MsgBox strList

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


bbnimda said:
I didn't found the right function to use in my Form, can U help me

Thks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Each folder has a Folders collection containing its subfolders
 
It work's fine

I've an other request for U, In my form I use a combo where I list all
contact in a target folder, but i did'nt find the way to fill my combo with
the list of contact Sorted in alphabetical order here is my function can U
help me Thks in advance

Set RepFdv = Application.GetNamespace("MAPI").Folders("publics
folders").Folders("all publics
folders").Folders("ContactAB").Folders("target")
totalFdv=RepFdv.items.count
Set FormPage = Item.GetInspector.ModifiedFormPages("Pr1")
Set Control = FormPage.Controls("ListUser")
Control.clear
MyIndex=0
NbrI=0
switch=0
do while monindex < totalFdv
MyIndex=MyIndex+1
Set myItem = RepFdv.Items(MonIndex)
Control.addItem myItem.fullname
loop






bbnimda said:
Tks Sue,

I'll try this immediatly

@+

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message de %[email protected]...
Again, you need to start with the first folder you're interested in, and
work with its Folders collection:

strList = ""
For Each objFolder in myFolder.Folders
strList = strList & objFolder.Name & vbCrLf
Next
MsgBox strList

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


bbnimda said:
I didn't found the right function to use in my Form, can U help me

Thks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Each folder has a Folders collection containing its subfolders

bbnimda said:
Hi all,

How can I obtain à list of subfolder (contact) in Outlook Public Folder
eg:
Business

Business
|__ Customer
|__ Provider
|__ Reseler
Private
|__Family
|__Frends


Thks
 
Instantiate an explicit Items collection for the target folder and call its Sort method, using the desired field name, before you iterate the Items collection.
 
Back
Top