Share via


Document.Category Property

Visio Automation Reference

Gets or sets the value of a document's category, one of the document properties. Read/write.

Version Information
 Version Added:  Visio 5.0

Syntax

expression.Category

expression   A variable that represents a Document object.

Return Value
String

Remarks

Setting the Category property is equivalent to entering information in the Category box in the Properties dialog box (File menu).

Example

This Microsoft Visual Basic macro shows how to use the Category property to categorize a drawing. It adds a Document object to the Documents collection and sets the Document object's Category property as well as other properties.

Before running this macro, substitute your own values for the items in italic in the following code. To verify that these properties have been set, open the Properties dialog box.

Visual Basic for Applications
  
Public Sub Category_Example()
 
    Dim vsoDocument As Visio.Document 
Set vsoDocument = Documents.Add("") 

'Set the properties of the document. 
vsoDocument.Title = "<em>document title</em>" 
vsoDocument.Creator = "<em>author name</em>" 
vsoDocument.Description = "<em>document description</em>" 
vsoDocument.Keywords = "<em>keyword1, keyword2, keyword3</em>" 
vsoDocument.Subject = "<em>document subject</em>" 
vsoDocument.Manager = "<em>manager name</em>" 
vsoDocument.Category = "<em>document category</em>" 

End Sub

See Also