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

Document.SolutionXMLElement Property (Visio)

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

Contains solution-specific, well-formed XML data stored with a document. Read/write.


expression . SolutionXMLElement( ElementName )

expression A variable that represents a Document object.


NameRequired/OptionalData TypeDescription
ElementNameRequiredStringThe case-sensitive name of the SolutionXML data element.

Return Value



The value of ElementName must match the value of the SolutionXML element's Name attribute. For example, if a solution's XML data began with the statement , use the ElementName "somename" to retrieve that data.

  • If ElementName already exists, the SolutionXMLElement property overwrites existing XML data. Use the SolutionXMLElementExists property before writing XML data to avoid losing data unintentionally.

  • If ElementName does not exist, the SolutionXMLElement property creates an element by that name.

Because your XML data is validated when you write it, you will typically perform this operation during a DocumentSaved event for performance reasons.

At the document level, if the XML data you pass to the SolutionXMLElement property is well formed and contains a valid schema and namespace declaration, it is saved as nested XML within the Microsoft Visio VDX file format. If you pass invalid XML data, Visio converts this data to an XML comment so that the data is not lost. However, if you subsequently load the saved VDX file containing the comment into Visio, the XML comment will be ignored, and consequently the data will be lost.

If you put invalid or non-well-formed XML data into a cell, Visio saves it as a string in the cell so that it is not lost and can perhaps later be fixed.

© 2018 Microsoft