AlternateNames property

AlternateNames property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

See also         Example         Applies to

Gets or sets the alternate names for a document.

Version added

2000

Syntax

        
          strRet = object.AlternateNames
      
        
          object
          .AlternateNames = strExpression
      

strRet

String. One or more file names delimited by semicolons.

object

Required. An expression that returns a Document object.

strExpression

Required String. One or more file names delimited by semicolons. For example, "My Shapes 99.vss"; "My Shapes 98.vss".

Remarks

The application stores document names in the following situations:

  • Templates store stencil names. For example, the Basic Flowchart template stores the names of the Basic Flowchart Shapes.vss and Backgrounds.vss stencils. These stencils are opened with the Basic Flowchart template.
  • Master shortcuts store stencil names. For example, a shortcut for the Data shape stores the name of the stencil on which the Data shape is stored—Basic Flowchart Shapes.vss.

When the application opens a document or accesses the Document object's collection, it uses the document name. If Visio can't find the document name, it looks for alternate names for those stencils that are in the correct path (on the Tools menu, click Options, and then click the File Paths tab to add a path). For example, suppose you created the stencil named "My Shapes 98.vss." The following year you revised the stencil and renamed it "My Shapes 99.vss." Any templates that opened My Shapes 98.vss should now open My Shapes 99.vss. To do this, set the AlternateNames property of My Shapes 99.vss to "My Shapes 98.vss." The following VBA code shows one way to do this:

  Visio.Documents("My Shapes 99.vss").AlternateNames = "My Shapes 98.vss"

The AlternateNames property is empty until you set it through Automation. Each of the alternate names in the string should contain the file name, with no folder information. You can also include comments in angle brackets (<>) as the application ignores anything in angle brackets. For example, you could set the AlternateNames property like this:

  Visio.Documents("HRShapes.vss").AlternateNames = "Human Resources Shapes.vss";<old name>;"HRDept Shapes.vss"