WebFolder Object
SharePoint Designer Developer Reference |
Represents a folder in a Web site.
Remarks
The WebFolder object is a member of the WebFolders collection.The Folder object is a pointer to the WebFolder object.The WebFolders collection represents all of the folders in a specified Web site. Within the WebFolders collection, individual WebFolder objects are indexed beginning with zero. The WebFolder object is similar to a folder in a directory-based hierarchy; however, the relationship between WebFolder objects and Web objects is unique. You can create multiple Web objects on a Web server. Any WebFolder can represent a Web site, but every WebFolder does not necessarily represent a Web site. The folder hierarchy provides the link to folders and files on a Web server directory. The navigation structure provides the underlying structure for the Web objects within individual Office SharePoint Designer–based Web sites.
Use WebFolders(Index), where Index is the property key of a folder, to return a single WebFolder object. The following example returns the file name of the first folder item in the WebFolders collection.
Visual Basic for Applications |
---|
|
Use the collection properties such as Files, Folders, or Properties to return the collection object for the specified item. The following statements return the first specified item in the collection for the active Web site.
Visual Basic for Applications |
---|
|
Use properties such as IsExecutable, IsReadable, and IsRoot to check for the specified state of the folder. If you want to execute CGI scripts, you can add the scripts to a folder and set the IsExecutable property of that folder to True. When you have content in a folder that you want others to browse, you can set the IsReadable property to True. If you want to determine whether the current folder is the root folder, you can use the IsRoot property.The following example determines whether files in the current WebFolder object are executable, read-only, or located in a root folder.
Visual Basic for Applications |
---|
|
The IsExecutable, IsReadable, and IsWriteable properties return information about the state of the folder. The following examples show how to set the IsExecutable and IsReadable properties and read the IsWriteable property.
Note
You cannot set the IsWriteable property; however, you can set the IsExecutable and IsReadable properties for a WebFolder object.
Visual Basic for Applications |
---|
|
Folders (or WebFolders collection) in Office SharePoint Designer serve two purposes. They can be folders that help manage the contents of a Web site, or they can be entire Web sites. A Web site can have multiple subsites below it. The IsWeb property returns True if the folder is a Web subsite. The following example uses the IsWeb property to determine whether a folder is a Web subsite and, if so, opens the Web site.
Note
To run this example, you must have a Web site named "C:\My Documents\My Web Sites\Coho Winery", or you may substitute an alternative Web site URL.
Visual Basic for Applications |
---|
|
Use the Url property to return the URL of the current WebFolder object. The following statement returns the absolute URL for the eighth folder in the active Web site.
Visual Basic for Applications |
---|
|
Use the Copy, Delete, and Move methods to maintain your Web site structure. The following statement copies a WebFolder object from one folder to another folder, updates the links during the copy process, and forces an overwrite if the file already exists.
Visual Basic for Applications |
---|
|
See Also