Diagram

Diagram class

Root element of Visio objects hierarchy.

public class Diagram : IDisposable

Constructors

Name Description
Diagram() The default constructor.
Diagram(Stream) Public class constructor, loads the diagram from the stream.
Diagram(string) Public class constructor, loads the diagram from the file.
Diagram(Stream, LoadFileFormat) Public class constructor, loads the diagram from the stream using predefined format.
Diagram(Stream, LoadOptions) Public class constructor, loads the diagram from the stream using predefined load file options.
Diagram(string, LoadFileFormat) Public class constructor, loads the diagram from the file using predefined format.
Diagram(string, LoadOptions) Public class constructor, loads the diagram from the file using predefined load file options.

Properties

Name Description
ActivePage { get; } Specifies the active page
Buildnum { get; set; } The build number of the Visio instance used to create the document.
Colors { get; } Contains 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.
DataConnections { get; } Contains the DataConnection elements for the document.
DataRecordSets { get; } The collection of DataRecordset objects associated with a Document object.
DocLangID { get; set; } The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
DocumentProps { get; } Contains document property elements such as the document’s title, author, and so on.
DocumentSettings { get; } Contains elements that specify document settings.
DocumentSheet { get; } Specifies a document’s ShapeSheet structure.
EmailRoutingData { get; set; } Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
EventItems { get; } Contains an EventItem element for each event to which an object should respond.
FontDirs { set; } Indicates the Fonts folder path
Fonts { get; } Contains a collection of Font elements
HeaderFooter { get; } Contains elements for a document’s header and footer.
InterruptMonitor { get; set; } Gets and sets the interrupt monitor.
Key { get; set; } Indicates 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.
Masters { get; } Collection Master objects.
Metric { get; set; } Whether 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.
Pages { get; } Collection Page objects.
RibbonX { get; set; } The Ribbon XML string that is passed to the document to customize the ribbon user interface.
SolutionXMLs { get; } XML value.
Start { get; set; } Indicates 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.
StyleSheets { get; } Collection StyleSheet objects.
UserCustomUI { get; set; } The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
Validation { get; } Stores information about diagram validation for the document.
VbaProject { get; } Gets the VbaProjectVbaProject.
VbProjectData { get; set; } Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.
Version { get; set; } The version number of the Visio instance. Microsoft Visio 2010 = 14.
Windows { get; } Contains the Window elements for a document.

Methods

Name Description
AddMaster(Diagram, string) Adds master to diagram from source diagram by master’s Name or NameU.
AddMaster(Stream, int) Adds master to diagram from template stream by master’s ID.
AddMaster(Stream, string) Adds master to diagram from template stream by master’s Name or NameU.
AddMaster(string, int) Adds master to diagram from template file by master’s ID.
AddMaster(string, string) Adds master to diagram from template file by master’s Name or NameU.
AddShape(Shape, string, int) Adds shape created by master to specific page.
AddShape(double, double, string, int) Adds shape created by master on page with defined PinX and PinY.
AddShape(double, double, double, double, string, int) Adds shape created by master on page with defined PinX,PinY,Width and Height.
Combine(Diagram) Combines another Diagram object.
CopyTheme(Diagram) Copies Theme from a source Diagram.
Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
GetDefaultFontDir() Get the Default Fonts folder path
GetUnusedStyles() Get unused Styles
HasHiddenInfo() Indicates whether this diagram has hidden information.
Layout(LayoutOptions) Lays out the shapes and/or reroutes the connectors for all pages of diagram.
Print() Prints the whole document to the default printer.
Print(PrinterSettings) Prints the document according to the specified printer settings,using the standard (no User Interface) print controller.
Print(PrintSaveOptions) Prints the whole document to the default printer.
Print(string) Print the whole document to the specified printer,using the standard (no User Interface) print controller.
Print(PrinterSettings, PrintSaveOptions) Prints the document according to the specified printer settings,using the standard (no User Interface) print controller.
Print(PrinterSettings, string) Prints the document according to the specified printer settings,using the standard (no User Interface) print controller and a document name.
Print(string, PrintSaveOptions) Print the whole document to the specified printer,using the standard (no User Interface) print controller.
Print(string, string) Prints the document,using the standard (no User Interface) print controller and a document name.
Print(PrinterSettings, string, PrintSaveOptions) Prints the document according to the specified printer settings,using the standard (no User Interface) print controller and a document name.
Print(string, string, PrintSaveOptions) Prints the document,using the standard (no User Interface) print controller and a document name.
Refresh() Invokes Refresh method for all DataRecordSet in the Diagram.
RemoveHiddenInformation(int) Remove unused information
RemoveMacro() Removes VBA/macro from this diagram.
Save(Stream, SaveFileFormat) Saves the diagram data to the stream.
Save(Stream, SaveOptions) Saves the diagram to a stream using the specified save options.
Save(string, SaveFileFormat) Saves the diagram data to the file.
Save(string, SaveOptions) Saves the document to a file using the specified save options.
static Export(Stream, Stream) Exports the diagram from vsd stream to vdw stream format. Not implemented yet.
static Export(Stream, string) Exports the diagram from vsd stream to *.vdw file format. Not implemented yet.
static Export(string, Stream) Exports the diagram from vsd file to vdw stream format. Not implemented yet.
static Export(string, string) Exports the diagram from vsd to vdw format. Not implemented yet.

See Also