SPFolderHierarchy.GetSubFolder Method
Gets the direct subfolder by name.
Namespace: Microsoft.Office.Server.Utilities
Assembly: Microsoft.Office.Server (in Microsoft.Office.Server.dll)
Syntax
'Declaration
Public Shared Function GetSubFolder ( _
parentFolder As SPFolder, _
strFolderName As String, _
fEnsure As Boolean _
) As SPFolder
'Usage
Dim parentFolder As SPFolder
Dim strFolderName As String
Dim fEnsure As Boolean
Dim returnValue As SPFolder
returnValue = SPFolderHierarchy.GetSubFolder(parentFolder, _
strFolderName, fEnsure)
public static SPFolder GetSubFolder(
SPFolder parentFolder,
string strFolderName,
bool fEnsure
)
Parameters
- parentFolder
Type: Microsoft.SharePoint.SPFolder
The parent folder.
- strFolderName
Type: System.String
The name of the folder.
- fEnsure
Type: System.Boolean
Whether to ensure the folder’s creation.
Return Value
Type: Microsoft.SharePoint.SPFolder
The retrieved folder.
Returns SPFolder.
Remarks
This method does not inflate the SPFolder.SubFolders collection since that property can be throttled in large lists. Therefore multiple calls for the subfolders of the same folder, will cause a query to be performed each time.