|
To get a MAPIFolder object
Outlook provides no built-in way to get a folder if all you know
is its name. This sample for getting a MAPIFolder object is based on a
path, such as "Public Folders/All Public Folders/Company/Sales". This
is an important technique, since you need a MAPIFolder any time you
want to move an item. The VB/VBA and VBScript versions differ mainly
in their error-handling and declarations.
Usage for either the VB/VBA or VBScript version:
Set objFolder = GetFolder("Public Folders/All Public
Folders/Company/Sales")
The path argument needs to be in quotation marks and exactly
match the folder hierarchy that the user sees in the Folder List. An
easy way to see the path string is to display the Web toolbar (View
| Toolbars) and look in its Address box. Omit the "Outlook:"
prefix if you copy the path string for use with GetFolder().
NOTE: If any folder
name in the path string
contains a "/" or "\" character,
this routine will not
work, because it assumes
that those characters
are delimiters in the
path string.
VBA/VB | VBScript |
More Information
|