This property specifies the default Search catalog.
Syntax
ISearchServer.DefaultCatalog
Example
The following example prompts the user whether they want to change the default catalog to one of the displayed catalog names.
Option Explicit
On Error Resume Next
Dim objSearchAdmin, objSearchServer, objCatalogs, objCatalog
Dim Prompt, Buttons, Title, Response
Set objSearchAdmin = CreateObject("Search.SearchAdmin.1")
Set objSearchServer = objSearchAdmin.SearchServer
Set objCatalogs = objSearchServer.SearchCatalogs
For Each objCatalog in objCatalogs
Prompt = "Would you like to make " & Chr(13) & objCatalog.Name
& Chr(13) & "the default catalog?"
Buttons = vbYesNo + vbDefaultButton2 + vbExclamation + vbSystemModal
Title = "MsgBox Test"
Response = MsgBox(Prompt, Buttons, Title)
If Response = vbYes Then
objSearchServer.DefaultCatalog = objCatalog.Name
End If
Next
'Release objects
Set objCatalogs = Nothing
Set objSearchServer = Nothing
Set objSearchAdmin = Nothing
See Also
CatalogsLocation, SearchCatalogs