Office VBA教程:SearchScopes属性



expression   必需。该表达式返回“应用于”列表中的对象之一。


本示例显示 SearchScopes集合中所有当前可用的 SearchScope对象。

Sub DisplayAvailableScopes()
    'Declare a variable that references a
    'SearchScope object.
    Dim ss As SearchScope
    'Use a With...End With block to reference the
    'FileSearch object.
    With Application.FileSearch
        'Loop through the SearchScopes collection
        For Each ss In .SearchScopes
            Select Case ss.Type
                Case msoSearchInMyComputer
                    MsgBox "My Computer is an available search scope."
                Case msoSearchInMyNetworkPlaces
                    MsgBox "My Network Places is an available search scope."
                Case msoSearchInOutlook
                    MsgBox "Outlook is an available search scope."
                Case msoSearchInCustom
                    MsgBox "A custom search scope is available."
                Case Else
                    MsgBox "Can't determine search scope."
            End Select
        Next ss
    End With
End Sub

上页:Office VBA教程:SearchFolders属性 下页:Office VBA教程:SearchSubFolders属性

Office VBA教程:SearchScopes属性

Office VBA教程:SearchSubFolders属性 Office VBA教程:SearchWhenProgramming属性
Office VBA教程:SecondValue属性 Office VBA教程:SelectedItems属性
Office VBA教程:Shape属性 Office VBA教程:ShortcutText属性
Office VBA教程:SignDate属性 Office VBA教程:Signer属性
Office VBA教程:Sounds属性 Office VBA教程:State属性
Office VBA教程:Style属性 Office VBA教程:Table属性
Office VBA教程:Tag属性 Office VBA教程:Text属性
Office VBA教程:TextOrProperty属性 Office VBA教程:TipOfDay属性
Office VBA教程:Title属性 Office VBA教程:TooltipText属性
Office VBA教程:Top属性 Office VBA教程:Type属性
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号