VisioPowerShell
Version 4.5
Version 4.5
  • Introduction
  • Quick start
  • Links
  • Basics
    • Geometry primitves
    • Context-sensitivity
    • Drop shape masters
    • Format shapes with cells
    • Draw basic shapes
    • Create pages
    • Enumerate shapes
    • Bound Visio application
    • Close Visio applications
    • List cmdlets
    • List of all cmdlets
    • Get help for a cmdlet
    • Tips
    • Verbose logging
  • Automatic diagrams
    • Org charts from XML
    • Directed graphs from code
    • Directed graphs from XML
      • Sample Directed Graph XML 1
      • Sample Directed Graph XML 2
      • Sample Directed Graph XML 3
      • Sample Directed Graph XML 4
  • Samples
    • Draw grid
    • Draw fill patterns - slow
    • Draw fill patterns - fast
    • Countdown days
  • Installation
    • Install VisioPS
    • Uninstall VisioPS
    • Detect if VisioPS is installed
  • Technical notes
    • Visio
      • Visio version compatibility
      • Create a new Visio application COM object
    • PowerShell
      • Install PowerShell
      • Detect installed PowerShell version
      • PowerShell version compatibility
      • Use PowerShell 2 with .NET Framework 2.0
    • VisioClient
    • Use VisioAutomation
  • Cmdlets
    • Documents
      • Close-VisioDocument
      • Get-VisioDocument
      • New-VisioDocument
      • Open-VisioDocument
      • Save-VisioDocument
    • Container
    • Custom properties
      • Get-VisioCustomProperty
      • Remove-VisioCustomProperty
      • Set-VisioCustomProperty
      • Examples
    • Hyperlinks
      • Get-VisioHyperlink
      • New-VisioHyperlink
      • Remove-VisioHyperlink
    • Master
      • Get-VisioMaster
    • Pages
      • Copy-VisioPage [TBD]
      • Export-VisioPage
      • Format-VisioPage
      • Get-VisioPage
      • Measure-VisioPage
      • New-VisioPage
      • Remove-VisioPage
      • Select-VisioPage [TBD]
    • PageCells
    • Shapes
      • Connect-VisioShape
      • Copy-VisioShape
      • Export-VisioShape
      • Format-VisioShape
      • Get-VisioShape
      • Join-VisioShape
      • Lock-VisioShape
      • Select-VisioShape
      • Select-VisioShape Invert
      • Select-VisioShape -None
      • Split-VisioShape
      • Test-VisioShape
      • Unlock-VisioShape
      • Examples of Join-VisioShape and Split-VisioShape
    • ShapeCells
      • Set-VisioShapeCells for text
      • Shape cells
    • User-defined cells
      • Get-UserDefinedCell
      • Set-VisioUserDefinedCell
      • Remove-UserDefinedCell
    • Selection
      • Export-VisioSelection
      • Test-VisioSelectedShapes
    • Text
      • Get-VisioText [TBD]
      • Set-VisioText
    • VisioApplication
      • Close-VisioApplication
      • Get-VisioApplication
      • New-VisioApplication
      • Out-VisioApplication
      • Test-VisioApplication
      • Undo-VisioApplication
      • Redo-VisioApplication
    • Windows
      • Format-VisioWindow
  • Developer Info
    • Release history
    • Publis to PowerShell Gallery
    • Debug with Visual Studio
Powered by GitBook
On this page
  1. Basics

Bound Visio application

When you use VisioPS there cmdlets it typically needs an active instance of Visio to be running - this is called the bound Visio application.

Bind to a new Visio application

New-VisioApplication

Note that New-VisioApplication does NOT return an application object.

Getting the currently bound Visio application

$visapp = Get-VisioApplication

Broken binding

Suppose you have a bound instance and then you go to the that instance in the UI and close the application. VisioPS still thinks it bound to that instance - it still "has a pointer" to it. But of course, that pointer is now invalid and any commands that try to interact with the (now non-existent) Visio application will fail.

Verifying the bound Visio application

Use Test-VisioApplication to verify that a Visio application instance is bound ans that VisioPS can successfully communicate with it.

if (Test-VisioApplication)
{
    # the bound application is valid
}
else
{
    # the bound application is not valid
}
PreviousEnumerate shapesNextClose Visio applications

Last updated 6 years ago