Propriedade ScopeFolder. Path (Office)ScopeFolder.Path property (Office)
Obtém uma cadeia de caracteres indicando o caminho completo de um objeto ScopeFolder .Gets a String indicating the full path of a ScopeFolder object. Somente leitura.Read-only.
SintaxeSyntax
expressão. Caminhoexpression.Path
expressão Uma variável que representa um objeto ScopeFolder .expression A variable that represents a ScopeFolder object.
ExemploExample
O exemplo a seguir exibe o caminho raiz de cada diretório em meu computador.The following example displays the root path of each directory in My Computer. Para recuperar essas informações, o exemplo obtém primeiro o objeto ScopeFolder na raiz do meu computador.To retrieve this information, the example first gets the ScopeFolder object at the root of My Computer. O caminho desse ScopeFolder será sempre "*".The path of this ScopeFolder will always be "*". Como em todos os objetos ScopeFolder , o objeto raiz contém uma coleção ScopeFolders .As with all ScopeFolder objects, the root object contains a ScopeFolders collection. Este exemplo faz um loop por meio dessa coleção ScopeFolders e exibe o caminho de cada objeto ScopeFolder nele.This example loops through this ScopeFolders collection and displays the path of each ScopeFolder object in it. Os caminhos desses objetos de ScopeFolder serão A:\
, C:\
etc.The paths of these ScopeFolder objects will be A:\
, C:\
, etc.
Sub DisplayRootScopeFolders()
'Declare variables that reference a
'SearchScope and a ScopeFolder object.
Dim ss As SearchScope
Dim sf As ScopeFolder
'Loop through the SearchScopes collection
'and display all of the root ScopeFolders collections in
'the My Computer scope.
For Each ss In SearchScopes
Select Case ss.Type
Case msoSearchInMyComputer
'Loop through each ScopeFolder collections in
'the ScopeFolders collection of the
'SearchScope object and display the path.
For Each sf In ss.ScopeFolder.ScopeFolders
MsgBox "Path: " & sf.Path
Next sf
Case Else
End Select
Next ss
End Sub
Confira tambémSee also
Suporte e comentáriosSupport and feedback
Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação?Have questions or feedback about Office VBA or this documentation? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.