A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Errors when returning Outlook folder properties



 
 
Thread Tools Search this Thread Display Modes
  #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
  #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!


  #3  
Old January 7th 09, 02:42 AM posted to microsoft.public.outlook.program_vba
ziggy
external usenet poster
 
Posts: 7
Default Errors when returning Outlook folder properties

Indeed FolderPath doesn't return much useful data. I ended up using a bit of
..StoreID hacking which gives the full path.

Thanks


"Ken Slovak - [MVP - Outlook]" wrote:

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!



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OL 2007 Auto Archiving Errors/Cannot read archive properties from Deputy5211 Outlook - General Queries 9 January 24th 08 09:11 PM
Strange description in Outlook 2007 folder properties Charles W Davis Outlook - General Queries 0 May 31st 07 03:39 PM
Outlook 2003- named properties v/s user properties ? newToOutlookProgramming Add-ins for Outlook 2 May 18th 07 07:38 PM
Setting custom properties to an outlook folder Michael Jennings Outlook and VBA 3 March 16th 07 06:50 AM
Setting custom properties to an outlook folder Michael Jennings Outlook - General Queries 3 March 15th 07 02:24 PM


All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.