Visio SaveAsWebObject on Powershell


hey guys..

im trying build simple script open visio drawing, export html , close..

i got 1 work method export, exporting without crtl function show shape data , other things, if can give me awesome

$directory = "c:\visio\" $filename = "drawing" $application = new-object -comobject visio.application $application.visible = $true $document = $application.documents.open("$directory$filename.vsdm") $objsaveasweb = $application.saveaswebobject $vsowebsettings = $objsaveasweb.webpagesettings $vsowebsettings.startpage = 1 $vsowebsettings.endpage = 2 $vsowebsettings.targetpath= "$directory$filename.htm" $objsaveasweb.createpages $document.saved = $true $application.quit()

once try run get

the property '*' cannot found on object

its happening startpage, endpage, targetpath

don't know if im referencing object on right way.

thanks


mcts - sccm


hi josé luiz schenardie,

please try script below export visio pages html file, please note haven't tested:

$directory = "c:\users\username\" $filename = "visiooriginal" $application = new-object -comobject visio.application $application.visible = $false $document = $application.documents.open("$directory$filename.vsd") $pages = $application.activedocument.pages  ($i=1; $i -le $pages.count; $i++) { $page = $pages.item($i) $pagename = $page.name $page.export("$directory$filename-$pagename.htm") }  $application.quit()

reference from:

using powershell export multiple visio pages .png files

selection.export method (visio)

in addition, receive error because method can not found object, please run "$vsowebsettings|get-member" available methods.

if have feedback on our support, please click here.

best regards,

anna

technet community support



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Azure MFA with Azure AD and RDS

Failed to setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html