Outlook Script : How to get the current Folder

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

bbnimda

Hi All,

How can I get the current folder, from where my form is launched,
I need to get also the parent

tks for help
 
Application.ActiveExplorer.?urrentFolder
Application.ActiveExplorer.?urrentFolder.Parent
 
Hi Sue,

I didn't explain my self corectly (do to my bad english) here is an example
of my pb

my Outlook publics folder look like something like this

Publics Folder
|__All publics Folders
|__Business
| |__Companies
| |__Contacts
| |__Customers
| |__Done
| |__Providers
| |__Waiting
|__Private
|__Done
|__Waiting

Now if I want to jump from Business SubFolders (Waiting) to an other (Done)
I use this code

TheFolder = TARGET ' Target = on of my business folder ex: Done
Set myFolder = Application.GetNamespace("MAPI").Folders("publics
folders").Folders("all publics
folders").Folders("Business").Folders("TARGET")

and I repeat this each time I need to change folder

So I'm asking my self if there isn't a way faster and easier like getint the
current PATH and go to other folder by changing the last item of the path

like dos command ?

I hope my question est clear




"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Application.ActiveExplorer.?urrentFolder
Application.ActiveExplorer.?urrentFolder.Parent
 
All folders have a Parent property that represents the parent folder and a Folders property that holds the collection of subfolders. You use those to walk up and down the folder hierarchy. If TheFolder is the Business\Waiting folder, then this expression would return the Business\Done folder: TheFolder.Parent.Folders("Done")

--
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:
Hi Sue,

I didn't explain my self corectly (do to my bad english) here is an example
of my pb

my Outlook publics folder look like something like this

Publics Folder
|__All publics Folders
|__Business
| |__Companies
| |__Contacts
| |__Customers
| |__Done
| |__Providers
| |__Waiting
|__Private
|__Done
|__Waiting

Now if I want to jump from Business SubFolders (Waiting) to an other (Done)
I use this code

TheFolder = TARGET ' Target = on of my business folder ex: Done
Set myFolder = Application.GetNamespace("MAPI").Folders("publics
folders").Folders("all publics
folders").Folders("Business").Folders("TARGET")

and I repeat this each time I need to change folder

So I'm asking my self if there isn't a way faster and easier like getint the
current PATH and go to other folder by changing the last item of the path
"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Application.ActiveExplorer.?urrentFolder
Application.ActiveExplorer.?urrentFolder.Parent
 
Back
Top