Document.DiagramServicesEnabled property (Visio)

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

Syntax

expression.DiagramServicesEnabled

expression An expression that returns a Document object.

Return value

Long

Remarks

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.

Constant Value Description
visServiceNone 0 No diagram services.
visServiceAll -1 All diagram services.
visServiceAutoSizePage 1 AutoSize (automatic page-sizing) behaviors.
visServiceStructureBasic 2 Structured-diagram behaviors that maintain existing relationships but don't create new relationships.
visServiceStructureFull 4 Structured-diagram behaviors that match all those in the user interface (UI).
visServiceVersion140 7 All diagram services that exist in Visio.
visServiceVersion150 8 All 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 don't 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.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.