Creating an IColumn Object

You create an IColumn object by calling the IColumns.Add method, as in the following example, where objColumn is the name you give to the IColumn object:

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSchema, objColumns, objColumn 
Dim Name, Description, Type, PropGuid, PropPid, Index, Retrieve, Length 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 
Set objBuildServer = objSearchAdmin.BuildServer 
Set objCatalogs = objBuildServer.BuildCatalogs 
Set objCatalog  = objCatalogs("KMSampleCatalog1")
Set objSchema   = objCatalog.Schema 
Set objColumns  = objSchema.Columns 

Name        = " HitCount" 
Description = "The number of hits (words matching query) in file" 
Type        = "I4" 
PropGuid    = "49691c90-7e17-101a-a91c-08002b2ecda9" 
PropPid     = "4" 
Index       = False 
Retrieve    = True 
Length      = 0 

Set objColumn = objColumns.Add Name, Description, Type, PropGuid, _
  PropPid, Index, Retrieve, Length 

...

'Release objects 
Set objColumn   = Nothing 
Set objColumns  = Nothing 
Set objSchema   = Nothing 
Set objCatalog  = Nothing 
Set objCatalogs = Nothing 
Set objBuildServer = Nothing 
Set objSearchAdmin = Nothing 
 

© 1997-1998 Microsoft Corporation. All rights reserved.