Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   How to define a folder object given its pathname (http://www.outlookbanter.com/outlook-vba/7582-how-define-folder-object-given.html)

jimboluke March 8th 06 07:11 PM

How to define a folder object given its pathname
 
How do I set a folder object to a folder from only its pathname?

I am trying to make a simple brute force routine for moving folders based on
a message box input. At first (not a good programmer), I am defining a set
of hard-coded folders (e.g. within a personal PST) based on the message box.
Trouble is reflecting my ignorance, I don't know how to simply create a
folder object based only on a pathname (e.g. \\A000\00). If I COULD do this,
then I could invoke a .Move method pretty simply.

Sue Mosher [MVP-Outlook] March 8th 06 07:58 PM

How to define a folder object given its pathname
 
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.outlookcode.com/d/code/getfolder.htm and, especially for public folders, http://www.outlookcode.com/codedetail.aspx?id=1164
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"jimboluke" wrote in message ...
How do I set a folder object to a folder from only its pathname?

I am trying to make a simple brute force routine for moving folders based on
a message box input. At first (not a good programmer), I am defining a set
of hard-coded folders (e.g. within a personal PST) based on the message box.
Trouble is reflecting my ignorance, I don't know how to simply create a
folder object based only on a pathname (e.g. \\A000\00). If I COULD do this,
then I could invoke a .Move method pretty simply.


jimboluke March 8th 06 10:07 PM

How to define a folder object given its pathname
 
It works! Thanks
-jim


All times are GMT +1. The time now is 07:56 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-2006 OutlookBanter.com