View Single Post
  #1  
Old January 6th 09, 05:09 AM posted to microsoft.public.outlook.program_vba
ziggy
external usenet poster
 
Posts: 7
Default Errors when returning Outlook folder properties

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