access to a specific folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can i access a specific folder. i tried the following but got an error. note: abc is the name of the folder i am trying to open

Dim newinbox As MAPIFolde

Set newinbox = Application.GetNamespace("MAPI").Folders("abc")
 
To get a non-default folder, you need to walk the folder hierarchy using the
Folders collections or use a function that does that for you. See
http://www.slipstick.com/dev/code/getfolder.htm

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



nelson said:
how can i access a specific folder. i tried the following but got an
error. note: abc is the name of the folder i am trying to open.
 
This peice of code will help if the folder is under the same group as the default inbox folder

Set myOlApp = Outlook.Applicatio

Set myNameSpace = myOlApp.GetNamespace("MAPI"

Set myRootFolder = myNameSpace.GetDefaultFolder(olFolderInbox).Paren

Set myDestFolder = myRootFolder.Folders("abc"

If you want to go to sub folders within abc, you just add this

Set mySubFolder = myDestFolder.Folders("abcSub"

I'm sure you get the point


----- nelson wrote: ----

how can i access a specific folder. i tried the following but got an error. note: abc is the name of the folder i am trying to open

Dim newinbox As MAPIFolde

Set newinbox = Application.GetNamespace("MAPI").Folders("abc")
 
Back
Top