Visio Guy

Visio Discussions => Programming & Code => Topic started by: schenardie on April 17, 2014, 12:31:41 AM

Title: Visio SaveAsWebObject + Powershell
Post by: schenardie on April 17, 2014, 12:31:41 AM
Hey Guys how are you??


Im trying to create a powershell script to simply open a visio drawing, save as web page and close (in a way that I can see at least shape properties, so I've tried with page.export to htm and doenst work)

Im not being able to set the WebPageSettings Properties through powershell, probably doing something wrong.

This is my code so far

$directory = "C:\Users\1\desktop\"
$filename = "Drawing"
$application = New-Object -ComObject Visio.Application
$application.visible = $True
$document = $application.Documents.Open("$directory$filename.vsdm")
$vsoSaveAsWeb = $application.SaveAsWebObject
$vsoWebSettings = $objSaveAsWeb.WebPageSettings
$vsoWebSettings.TargetPath = "$directory"
$vsoWebSettings.StartPage = 1
$vsoWebSettings.EndPage = 2
$vsoSaveAsWeb.CreatePages
$document.Saved = $True
$application.quit()


Thanks