Diagram class

Diagram class

Root element of Visio objects hierarchy.

The Diagram type exposes the following members:

Constructors

ConstructorDescription
Diagram()
Diagram(filename)Public class constructor,
loads the diagram from the file.
Diagram(stream)Public class constructor,
loads the diagram from the stream.
Diagram(filename, format)Public class constructor,
loads the diagram from the file using predefined format.
Diagram(stream, format)Public class constructor,
loads the diagram from the stream using predefined format.
Diagram(filename, options)Public class constructor,
loads the diagram from the file using predefined load file options.
Diagram(stream, options)Public class constructor,
loads the diagram from the stream using predefined load file options.

Properties

PropertyDescription
startIndicates whether the document has been modified outside of Visio.
If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.
keyIndicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.
metricWhether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to use English units.
buildnumThe build number of the Visio instance used to create the document.
versionThe version number of the Visio instance. Microsoft Visio 2010 = 14.
doc_lang_idThe unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
style_sheetsCollection StyleSheet objects.
mastersCollection Master objects.
pagesCollection Page objects.
document_propsContains document property elements such as the document’s title, author, and so on.
document_settingsContains elements that specify document settings.
colorsContains the document’s color table. Each document contains a single color table,
which lists the 24 standard colors that are available for application to objects
such as shapes, text, and layers in the document.
fontsContains a collection of Font elements
document_sheetSpecifies a document’s ShapeSheet structure.
active_pageSpecifies the active page
windowsContains the Window elements for a document.
event_itemsContains an EventItem element for each event to which an object should respond.
header_footerContains elements for a document’s header and footer.
vb_project_dataContains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.
email_routing_dataContains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
data_connectionsContains the DataConnection elements for the document.
data_record_setsThe collection of DataRecordset objects associated with a Document object.
ribbon_xThe Ribbon XML string that is passed to the document to customize the ribbon user interface.
user_custom_uiThe Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
validationStores information about diagram validation for the document.
solution_xm_lsXML value.
vba_projectGets the VbaProjectDiagram.vba_project.
interrupt_monitorGets and sets the interrupt monitor.

Methods

MethodDescription
save(filename, format)Saves the diagram data to the file.
save(stream, format)Saves the diagram data to the stream.
save(filename, options)
save(stream, options)
export(input_vsd, output_vdw)Exports the diagram from vsd to vdw format. Not implemented yet.
export(input_vsd, output_vdw)Exports the diagram from vsd file to vdw stream format. Not implemented yet.
export(input_vsd, output_vdw)Exports the diagram from vsd stream to *.vdw file format. Not implemented yet.
export(input_vsd, output_vdw)Exports the diagram from vsd stream to vdw stream format. Not implemented yet.
add_master(src_diagram, master_name)
add_master(template_stream, master_name)Adds master to diagram from template stream by master’s Name or NameU.
add_master(template_stream, master_id)Adds master to diagram from template stream by master’s ID.
add_master(template_file_path, master_name)Adds master to diagram from template file by master’s Name or NameU.
add_master(template_file_path, master_id)Adds master to diagram from template file by master’s ID.
add_shape(new_shape, master_name, page_number)Adds shape created by master to specific page.
add_shape(pin_x, pin_y, master_name, page_number)Adds shape created by master on page with defined PinX and PinY.
add_shape(pin_x, pin_y, width, height, master_name, page_number)Adds shape created by master on page with defined PinX,PinY,Width and Height.
print(options)
print()Prints the whole document to the default printer.
print(printer_name)Print the whole document to the specified printer,using the standard (no User Interface) print controller.
print(printer_name, options)
print(printer_settings, options)
print(printer_settings)Prints the document according to the specified printer settings,using the standard (no User Interface) print controller.
print(printer_settings, document_name, options)
print(printer_settings, document_name)Prints the document according to the specified printer settings,using the standard (no User Interface) print controller and a document name.
print(printer_name, document_name, options)
print(printer_name, document_name)Prints the document,using the standard (no User Interface) print controller and a document name.
copy_theme(source)
combine(second_diagram)
refresh()Invokes Refresh method for all DataRecordSet in the Diagram.
layout(options)
has_hidden_info()Indicates whether this diagram has hidden information.
remove_hidden_information(item)Remove unused information
get_unused_styles()Get unused Styles
get_default_font_dir()Get the Default Fonts folder path
remove_macro()Removes VBA/macro from this diagram.

See Also