Microsoft Office Tutorials and References
In Depth Information
technique can locate the default folders as well, based on their name, but the technique using the
GetDefaultFolder() method, described in the previous section, is easier to use.
In the folder hierarchy, what the user considers a top-level folder is in fact a second-level folder.
Thus, for example, in the folder structure shown in Figure 24.2, Clients is considered a
secondlevel folder and Acme, Consolidated, and National are third-level folders. The top-level folders are
Personal Folders, Archive Folders, Internet Calendar, and similar items.
To get a reference to a specific folder, you can use the function in Listing 24.1. This function is
passed the name of the desired folder and returns a reference to the desired folder, if it exists, or
else the value Nothing . Be aware that folder names in Outlook are case-sensitive. If the folder
does not exist, the value Nothing is returned. You can check for the Nothing value using Is
Nothing as explained earlier in this chapter.
This function looks at second- and third-level folders but does not go any deeper. Thus, looking
at the folder structure in Figure 24.2 the function would find Clients, and it would find Acme,
Consolidated, and National, but it would not find any folders nested deeper than that. It could
easily be modified to do so, however, and that would be a good programming exercise for you.
Understanding Outlook folder levels.