EnumDirectories method

Microsoft Visio Developer Reference

EnumDirectories method

       

Returns an array naming the folders Microsoft Visio would search given a list of paths.

Version added

4.5

Syntax

object.EnumDirectories pathList,nameArray

object

Required. An expression that returns an Application object.

pathList

Required String. A string of full or partial paths separated by semicolons.

nameArray

String. Array that receives the enumerated folder names.

Remarks

Several Visio properties such as AddonPaths and TemplatePaths accept and receive a string interpreted to be a list of path (folder) names separated by semicolons. Non-fully qualified names in the list are appended to the folder that contains the Visio program files (appObj.Path). When the application looks for items in the named paths, it looks in the folders and all their subfolders.

Suppose d:\Add-ons is a path that exists and e:\Add-ons is a path that doesn't exist. If the Visio executable file is installed in c:\Visio, and AddonPaths is "Add-ons;d:\Add-ons", the application looks for add-ons in c:\Visio\Add-ons, d:\Add-ons, and any of their subfolders.

The purpose of the EnumDirectories method is to accept a string such as one that the AddonPaths property might produce and return a list of the folders that the application enumerates when processing such a string.

If the EnumDirectories property succeeds, nameArray returns a one-dimensional array of n strings indexed from 0 to n - 1. Each string is the fully qualified name of a folder that exists. The list names those folders designated in the path list that exist and all their subfolders.

The nameArray argument is an out argument that is allocated by the EnumDirectories method and ownership is passed back to the caller. The caller should eventually perform the SafeArrayDestroy procedure on the returned array. (Visual Basic and Visual Basic for Applications automatically free the strings referenced by the array's entries.)