View Single Post
  #2  
Old January 6th 09, 03:01 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Errors when returning Outlook folder properties

Where does it error out? You need to step your code and see what's going on
and where it's choking.

At best the FolderPath for a PST file will be something like "\\Personal
Folders". It won't be the file system path to where that PST file is stored.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ziggy" wrote in message
...
I am trying to create a vbscript to go through users' Outlook folders and
return the paths to their PSTs.

Set myolApp = CreateObject("Outlook.Application")
Set objNS = myolApp.GetNameSpace("MAPI")
For Each objFolder in objNS.Folders
wscript.echo objFolder.Name & ": " & objFolder.FolderPath
Next

This works fine for a few of the folders (Public Folders, Mailbox, etc),
but
before it hits the PSTs it errors: "Microsoft Office Outlook: The
messaging
interface has returned an unknown error. If the problem persists, restart
Outlook."

Any ideas how I can get it to do all folders or even just the PSTs?
Thanks!


Ads