Properties Collection Object

See Also         Properties         Methods        

Application object
Webs object
Web object
Properties object

Application object
Webs object
Web object
RootFolder object
Files object
File object
Properties object

Application object
Webs object
Web object
RootFolder object

Folder object
Properties object

A collection of meta data as Property objects. Each item in the Properties collection represents an item associated with an individual Web, WebFile, or WebFolder object. For more information, refer to the table of PropertyKeys in Using the PropertyKeys. Choose a topic from the following list to go directly to that topic.

Using the Properties Object

Using the Properties Collection Within a Web

Using the PropertyKeys

Using the Properties Object

Use the Add method to add a property to the Properties collection. The following statement adds a copyright statement to the Properties collection.

ActiveWeb.Properties.Add "Copyright", _
    “Copyright 1999 by Rogue Cellars”)

You can also add and remove categories and approval levels.



Use the ApplyChanges method to apply a Property object that has been added to the collection of Properties. The following statements add and apply a copyright property to the Properties collection.

ActiveWeb.Properties.Add "Copyright", _
    “Copyright 1999 by Rogue Cellars”)
ActiveWeb.Properties.ApplyChanges

Use the Count property to return the total number of properties in the Properties collection. The following example checks that the number of properties in the Properties collection has increased since the Copyright property was added and applied to the collection, and then goes on to add the copyright to a web page.

Note   To run this example, you must have a web called "C:\My Documents\My Webs\Rogue Cellars" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\Rogue Cellars" (for a server running on Windows NT). In either case, you may substitute an alternative web URL or file.

Private Sub copyrightAdd()
Dim myWeb As Web
Dim myCopyright As String
Dim myCount As Integer
Dim myMessage As String

myCopyright = "Copyright 1999 by Rogue Cellars"
myCount = ActiveWeb.Properties.Count
myMessage = "No new properties have been added."

Set myWeb = Webs.Open("C:\My Webs\Rogue Cellars")
myWeb.Activate
ActiveWeb.Properties.Add "Copyright", myCopyright

If myCount <> ActiveWeb.Properties.Count – 1 Then
    MsgBox myMessage
    Exit Sub
End If

ActiveWeb.RootFolder.Files("Zinfandel.htm").Open
ActiveDocument.body.insertAdjacentText "BeforeEnd", _
    ActiveWeb.Properties("Copyright")
ActivePageWindow.Save
ActiveWeb.Close
End Sub

Use the Delete method to delete a single property. The following statement deletes the Copyright property from the Properties collection.

ActiveWeb.Properties.Delete("Copyright")

Use the Parent property when you want to return the container for the Properties collection. For example, the following statement returns the URL of the parent web.

myParentURL  = ActiveWeb.Properties.Parent.Url

Using the Properties Collection Within a Web

Use Properties(index), where index is the PropertyKey of the item in the Properties collection, to return a single property. The following example returns the value of the PropertyKey vti_hassearchbot.

Private Sub CheckForSearchBot()
Dim myProperties As Properties
Dim myFoundSearchBot As Boolean

Set myProperties = ActiveWeb.Properties

With myProperties
    myFoundSearchBot = .Item("vti_hassearchbot")
End With
End Sub

Important   The values for properties are variant—that is, each value can be a string, a Boolean, or an array. You can use the Typename() function to determine the type of the property value.

Note   To run the following example you must create a form that contains a text box called txtCategories. Also, notice that myCategories is declared as a variant type in this example. In a previous example, myFoundSearchBot was declared Boolean—but could also have been declared as a string.

Private Sub GetWebPropertyCategories()
Dim myProperties As Properties
Dim myCategories As Variant
Dim myCategory As Variant
Dim txtCategories As String

Set myProperties = ActiveWeb.Properties

With myProperties
    myCategories = .Item("vti_categories")
    For Each myCategory In myCategories
        txtCategories = txtCategories & "|" & myCategory
    Next
End With
End Sub

Using the PropertyKeys

The property keys can be a valuable tool for organizing information about your webs. For example, you can add categories to the master list of categories on your web.

Important   The category names can be added to the categories list using case sensitivity, but will not display with case sensitivity in the User Interface (UI). Because of this, a situation may occur where a user creates a category on the client, such as "Web Administrators", and a duplicate category exists on the server, such as "web administrators". In this case, in the UI, FrontPage will assign both categories to the "web administrators" category and neither of these can be deleted from the web (in the UI). Programmatically, the case sensitivity will correctly display in the Immediate and Local windows of the Visual Basic Editor.

The following example first adds a category to the properties for the active web, deletes the Waiting category from the same list (vti_categories), and then adds the new category to each of the files in the active web.

Note   When creating a new category, you must first add the new category to the web before you add it to any of the files. The procedure, AddCategories, adds a new category to the web and the next procedure, AddCategoryToFiles, adds the same category to all of the files in the web.

Private Sub AddCategories()
Dim myWeb As Web
Dim myCategory(2) As String
Dim myItem As Variant

Set myWeb = ActiveWeb
myCategory(0) = "+web administrators"
myCategory(1) = "-waiting"
ActiveWeb.Properties("vti_categories") = myCategory
ActiveWeb.Properties.ApplyChanges

'List all of the items in vti_categories in the Immediate window
For Each myItem In myWeb.Properties("vti_categories")
    Debug.Print myItem
Next
End Sub

Private Sub AddCategoryToFiles()
Dim myWeb As Web
Dim myCategories(1) As String
Dim myFiles As WebFiles
Dim myFile As WebFile
Dim myItem As Variant

Set myWeb = ActiveWeb
Set myFiles = myWeb.RootFolder.Files
myCategories(0) = "+web administrators"

For Each myFile In myFiles
    myFile.Properties("vti_categories") = myCategories
    myFile.Properties.ApplyChanges
    'List all the items in vti_categories in the Immediate window
    For Each myItem In myFile.Properties("vti_categories")
        Debug.Print myItem
    Next
Next
End Sub

Note   Although you can create new categories, such as "web administrators", that aren't included in the categories that are automatically installed with FrontPage, these new categories won't be visible in the User Interface (UI) until they are added to the web. Notice that in the previous example, the new category was added to the web first and will be visible in the UI.

The following table provides detailed information about the property keys available in FrontPage 2000. Notice that all property keys in FrontPage start with “vti_”. It is suggested that you prefix the property keys you want to add with a short name, such as an abbreviation for the name of your company, to reduce chances of naming conflicts with other properties.

Property Key Description Permission
vti_approvallevel The approval level set for a page. The available levels are AssignedTo, ReviewStatus, and Categories. Read/write
vti_approvallevels List of available approval levels that can be applied to documents in a web. This property key is a string vector (or an array of strings). Used to populate the web-wide list of known "review statuses" (also known as "approval levels") that are set for a document. The approval levels you can set are AssignedTo, ReviewStatus, and Categories. Read-only
vti_approvedby The authenticated name of the person who approved the page. Read-only
vti_assignedby The authenticated name of the person who assigned the page to a user. Read-only
vti_assigneddate This is the date that the page was last assigned to a user. Read-only
vti_assignedto The authenticated name of the person to whom the page is assigned. Read-only
vti_author Returns the author's name in string format. The identification of the authenticated author who has, or is, making changes to the document.

Note   This is different from the Author property stored as part of Microsoft Office document properties, which can be set by the user to any arbitrary value.

Read-only
vti_casesensitiveurls True if the web is running on a server where URLs are case sensitive, such as a server running UNIX. For example, if this property is set to True, then a file named MyFile.htm and a file named myFile.htm are treated as two separate files. Read-only
vti_categories The master list of categories. This property key is a string vector (or an array of strings) that is used for both web-level and document-level meta data. At the web level, the property key contains a list of all known categories that exist in the web. At the document level, it contains a list of all the categories to which the specified document belongs.

Note   These categories are automatically updated whenever a category is added or modified in any way.

Read/write
vti_clientvercutoff You can use this property key to set a version cutoff string. This is most commonly used in a multi-version environment to prevent older versions of the application from running on a specific server. For more information, see the FrontPage Server Extensions Resource Kit. Read/write
vti_dataconns List of data connections used by database features in FrontPage. Read-only
vti_defaultcharset The default character set for the web or page. Read-only
vti_defaultlanguage The default language for the web or page. Read-only
vti_description Provides a multi-line text box for the user to write comments in. Read/write
vti_donotpublish Set to True if the page is marked as "draft" or "not to be published." Read/write
vti_filesize The size of the file in bytes. Read-only
vti_generator This property key corresponds to the generator tag within an HTML document. The value of the vti_generator property key contains the name of the application that "generated" the document, which may be different from the application that was invoked to handle the page. For example, if you created or edited a page with Microsoft Word, and then retrieved the value of the vti_generator property key in Microsoft Visual Basic for FrontPage for that document, the value of the vti_generator property key would be Microsoft Word--even though the procedure call was generated by FrontPage. Valid values are "Microsoft Word", "Microsoft Access", "Microsoft FrontPage", and so on.

Note   FrontPage defers to Word when there's a theme conflict if the vti_generator property key contains "Microsoft Word".

Read-only
vti_globalpage Marks a page as global, that is, a top level page in the navigation structure, on the same level as, but not equal to, the home page. Read/write
vti_hasframeset True if the page contains framesets. This property key is used when constructing navigation bar links. When the page that is being linked is a frameset, the link's target attribute is forced to "_top". This causes the new page to replace the current frameset to prevent recursive framesets at browse time. Read-only
vti_hasruntimebots True if the page has run-time bots on it. Read-only
vti_htmlextensions A concatenated string of extensions used to specify a web file, such as htm.html.asp. Read-only
vti_httpdversion The version of FrontPage that is running on the httpd server. Read-only
vti_imagemapformat This property key sets the URL format used by the server-side image map processor. Valid values are NCSA and CERN. This property key is only useful for prior versions of FrontPage. FrontPage 2000 now uses client-side image maps. Read/write
vti_imagemapurlprefix Sets the server-relative URL of the server-side image-map processor for the selected image-map format. If the value of the vti_imagemapurlprefix property key is set to an empty string (""), server-side image maps are handled automatically by the FrontPage Server Extensions. For other formats, provide the name and location of the image-map processor. To specify client-side image maps, set this variable to an empty string. For more detailed information, refer to the FrontPage Server Extensions Resource Kit. Read/write
vti_insecureserverurl Retrieves the http:// URL (unsecured URL) for a Web site. Provides compatibility with older browsers that may not have secure browsing capability. For more information, see the FrontPage Server Extensions Resource Kit. Read-only
vti_isbrowsable True if the page folder is browsable. Use Folder.IsBrowsable to set this value.. Read-only
vti_ischildweb True if the specified folder is the root of a subweb. Use Folder.MakeWeb and Folder.RemoveWeb to modify. Read-only
vti_isexecutable Set this property to True to enable if this folder is marked for executable content on the server. Use Folder.IsExecutable to set this value. Read/write
vti_isscriptable Set this property to True to if enable scripting is enabled for a this folder. Use Folder.IsScriptable to set this value Read-write
vti_longfilenames True if the server supports file names that are longer than the standard 8.3 file format. (The 8.3 file format only supports file names with eight characters and extensions with three characters, such as "filename.txt".) Read-only
vti_metatags This property key corresponds to the contents within the META tags in an HTML document. All of the information contained in this property key is added to the META tags collection. Read-only
vti_modifiedby Authenticated name of the author who last modified the page. Read-only
vti_navbuttonhomelabel The image file associated with the button that links to the home page.

Note   This image is retrieved from the theme associated with the file and is not customizable.

Read/write
vti_navbuttonhomelabeltext The text that overlays the vti_navbuttonhomelabel.

Note   This text is customizable by the user.

Read/write
vti_navbuttonlabeltext The text that overlays the vti_nvabuttonuplabel.

Note   This text is customizable by the user.

Read/write
vti_navbuttonnextlabel The image file associated with the button that links to the next page in the navigation structure.

Note   This image is retrieved from the theme associated with the file and is not customizable.

Read/write
vti_navbuttonnextlabeltext The text that overlays the vti_navbuttonnextlabel.

Note   This text is customizable by the user.

Read/write
vti_navbuttonprevlabel The image file associated with the button that links tot he previous page in the navigation structure.

Note   This image is retrieved from the theme associated with the file and is not customizable.

Read/write
vti_navbuttonprevlabeltext The text that overlays the vti_navbuttonprevlabel.

Note   This text is customizable by the user.

Read/write
vti_navbuttonuplabel The image file associated with the button that links to the page one level up in the navigation structure.

Note   This image is retrieved from the theme associated with the file and is not customizable.

Read/write
vti_noclientimagemaps True if client image maps are prohibited. Read-only
vti_nonnavpage True if the page isn't associated with a navigation node within the navigation structure. Read/write
vti_nosourcecontrol True if the web is not being stored under source control. Prevents adding a file to source control if this property is set to True.

Note   If a file has previously been added to a source control project with the vti_nosourcecontrol property set to False, and the property is subsequently set to True, the file will not be removed from the source control project.

Read/write
vti_originator This property key corresponds to the "originator" META tag in an HTML document. The value of this property key contains the name of the application that created the document. You should never overwrite this property key with the name of another application. The vti_generator property key should be used to track the application that last "generated" the HTML page. Simply editing a document in FrontPage will change the value of the vti_generator property key to "Microsoft FrontPage". Valid values are "Microsoft Word", "Microsoft Access", "Microsoft FrontPage", and so on.

Note   FrontPage defers to Word when there's a theme conflict if the vti_generator property key contains "Microsoft Word".

Read-only
vti_privatetext The value of this property key must be an integer. Zero or not present is the default. A non-zero value means that the page won't be added to any text indexes. This property key only works with the built-in text indexing in FrontPage and is not recognized by Microsoft Internet Information Services (IIS). Read/write
vti_progid This corresponds to the "progid" META tag in an HTML document. The value of this property key determines which application opens the document when a user clicks (or double-clicks) the document's file name in Windows Explorer. Valid values are "FrontPage.Editor.Document", "Word.Document", "Excel.Sheet", "PowerPoint.Slide", "Access.Application".

Note   FrontPage defers to Word when there's a theme conflict if the vti_generator property key contains "Microsoft Word".

Read-only
vti_scriptlanguage Indicates which scripting language is enabled on the server. Read-only
vti_secureserverurl Retrieves the https://URL (secured URL) for a Web site. Provides a secure environment for confidential transactions over the Internet. For more information see the FrontPage Server Extensions Resource Kit. Read-only
vti_serveripaddress The IP address of the server.

Note   An IP address beginning with 127 represents a local server.

Read-only
vti_serverlanguage The language of the operating system. Used for localization purposes. Read-only
vti_showhiddenpages True if hidden pages are displayed. Read-only
vti_sourcecontrolcheckedoutby Authenticated name of the author who last checked out a page. Read-only
vti_sourcecontrolerror The error last returned by the source control system. This error is added to the META tag information if an error occurs while the file is being added to a source control project. Read-only
vti_sourcecontrolproject The name of the source control project. For a Microsoft Visual SourceSafe project, the string would include the "$" symbol, as in "$/myProject" Read-only
vti_sourcecontrolsystem The value of this property key is the type of source control in use on that web. Can be Microsoft Visual SourceSafe or Microsoft Frontpage Light Weight source control. Valid values for these two types of source control are "VSS" and "LW", respectively. This property key is set when a source control project is started. For more information on source control projects, refer to Managing Source Control Projects. Read-only
vti_sourcecontrolversion A numbered string that contains the version of the source control system that is in use. Read-only
vti_textextensions A concatenated string of extensions that are commonly used to denote text files. For example, the concatenated string might contain ".txt.rpt..." Read-only
vti_themedefault The default theme of the web. Read-only
vti_themesusecss True if CSS is used to present the theme. Read/write
vti_timecreated The timestamp when the page was created. The timestamp is in Universal Time Coordinate (UTC) or Greenwich time. Read-only
vti_timelastmodified The time that the page was last modified. The timestamp is in UTC time. This is only set when the author edits the page directly. Read-only
vti_timelastwritten The time that the page was last rewritten. The timestamp is in UTC time. Read-only
vti_-title The value of the text between the <TITLE> tags on the page. Read-only
vti_usernames The list of known user names for a specified web. Read-only
vti_webservertype The type of Web server. Valid values include, "MSIIS" for Microsoft Internet Information Services and "PWS" for Personal Web Server. Read-only
vti_welcomenames A concatenated list of file names that can be used as the file name for the home page, such as "index.htm index.html default.htm". Read-only