Categories

PowerShell and Visio – Opening a file

If all you want to do is open a Visio drawing then the simplest way is to use

Start-Process test.vsd

This will open the file in Visio ready for you to start work on it.

If you want to open the file and work on it programmatically then we have a little bit more to do.

001
002
$visio = New-Object -ComObject Visio.Application
$doc = $visio.Documents.Open("C:\Scripts\Visio\test.vsd")

Now we have our drawing we can start to do stuff with it

Leave a Reply