VBA/Excel/Access/Word/File Path/SearchFolders

Материал из VB Эксперт
Версия от 15:47, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

The SearchFolders Collection and ScopeFolder Objects

   <source lang="vb">

Private Sub SetRootFolder()

   Dim sfs As SearchFolders
   Dim sf As ScopeFolder
   Dim subsf As ScopeFolder
   Dim I As Integer
   Set sfs = Application.fileSearch.SearchFolders
   Set sf = Application.fileSearch.SearchScopes.Item(1).ScopeFolder
   With sf
       For Each subsf In .ScopeFolders
           If subsf.Path = rootFolder Then
               subsf.AddToSearchFolders
           End If
       Next subsf
   End With

End Sub

</source>