Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeVisio

Aliases: OfficeVisio, VisioNew
Module PSWriteOffice
Aliases
OfficeVisio VisioNew
Inputs
None
Outputs
OfficeIMO.Visio.VisioDocument System.IO.FileInfo

Creates a new OfficeIMO.Visio document with an initial page and optional DSL content.

Syntax

New-OfficeVisio [-Author <String>] [[-Content] <ScriptBlock>] [-Height <Double>] [-NoSave] [-Open] [-PageName <String>] [-PassThru] [-Path] <String> [-RequestRecalcOnOpen] [-Title <String>] [-Unit <Inches|Centimeters|Millimeters>] [-UseMastersByDefault] [-Width <Double>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

Create a simple service map.

OfficeVisio -Path .\ServiceMap.vsdx -Title 'Service map' -RequestRecalcOnOpen {
    VisioRectangle -Key web -Text 'Web' -X 1 -Y 4 -FillColor LightBlue
    VisioRectangle -Key api -Text 'API' -X 4 -Y 4 -FillColor LightGreen
    VisioConnector -From web -To api -EndArrow Triangle -Label 'calls'
}

Creates an editable .vsdx diagram with two shapes and a connector.

Parameters

-Author String optional
Optional document author.
-Content ScriptBlock optionalposition: 1
DSL script block describing Visio pages, shapes, and connectors.
-Height Double optional
Initial page height.
-NoSave SwitchParameter optional
Skip saving and emit the document object.
-Open SwitchParameter optionalaliases: Show
Open the document after saving.
-PageName String optional
Initial page name.
-PassThru SwitchParameter optional
Emit the document object instead of the saved file.
-Path String requiredposition: 0aliases: FilePath
Destination .vsdx path.
-RequestRecalcOnOpen SwitchParameter optional
Ask Visio to recalculate layout and connector routing when the document opens.
-Title String optional
Optional document title.
-Unit VisioMeasurementUnit optional
Measurement unit for page width and height.
Possible values: Inches, Centimeters, Millimeters
-UseMastersByDefault SwitchParameter optional
Use Visio masters for supported built-in stencil shapes when saving.
-Width Double optional
Initial page width.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.