Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Outlook personal folder through VB

Status
Not open for further replies.

johnnygeo

Programmer
Apr 23, 2003
125
US
I am using VB to read in the contents of an Outlook mail folder which is stored in a separate .pst file. I am able to read emails in from my inbox and from subfolders of my inbox, but I can't see how to get to a folder in a different folder set.

The folder name is "SurveysUnprocessed" and the .pst is c:\STG.pst

I guess it should look like this:

Code:
Set myOutlook = CreateObject("Outlook.Application")
Set myNS = myOutlook.GetNamespace("MAPI")
Set mySurveyFolder = myNS.getFolderFromID(???????)

but how do I find the ID of this folder?
 
Oh, I got it.

Code:
Set myNS = myOutlook.GetNamespace("MAPI")
Set myPSTFolder = myNS.Folders("Personal Folders")
Set mySurveyFolder = myPSTFolder.Folders("SurveysUnprocessed")


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top