Table of contents
Collapse the table of content
Expand the table of content

Document.DiagramServicesEnabled Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Determines which, if any, diagram services are enabled for the document. Read/write.


expression . DiagramServicesEnabled

expression An expression that returns a Document object.

Return Value



Visio has several diagram behaviors, including structured-diagram behaviors and AutoSize behaviors. Structured-diagram behaviors define when container-membership relationships and callout associations are created. AutoSize behaviors define when Visio automatically resizes the drawing page to adjust to changes in its contents.

In your solution, you can take advantage of these new diagram behaviors by using the DiagramServicesEnabled property to enable the services that aggregate these behaviors. When your solution modifies the diagram, Visio invokes the diagram behaviors associated with any of the services that are currently enabled.

The value of the DiagramServicesEnabled property setting must be one or a bitwise combination of the following constants from the VisDiagramServices enumeration.

visServiceNone0No diagram services.
visServiceAll-1All diagram services.
visServiceAutoSizePage1AutoSize (automatic page-sizing) behaviors.
visServiceStructureBasic2Structured-diagram behaviors that maintain existing relationships but do not create new relationships.
visServiceStructureFull4Structured-diagram behaviors that match all those in the user interface (UI).
visServiceVersion1407All diagram services that exist in Visio.
visServiceVersion1508All diagram services that exist in Visio.

If you combine visServiceStructureBasic and visServiceStructureFull , the latter overrides the former. However, you can combine visServiceAutoSizePage with either visServiceStructureBasic (3) or visServiceStructureFull (5) and assign either of those values to the property.

Diagram services apply only to solutions that manipulate Visio programmatically (by Automation). They do not have any effect on the behaviors that are exposed in the UI. UI settings that disable these behaviors have no effect on behaviors that are triggered programmatically.

By default, diagram services are disabled for a document. You must enable any services you want to take advantage of before your solution modifies the diagram. Diagram service settings are not persisted from one session of Visio to the next.

© 2017 Microsoft