Arrrgh, SaveAsWeb object is disabled

B

banzai256

I'm trying to write a simple VBScript to loop through the files in a
directory and run the SAW object against each of them. I can't create the
Visio.SaveAsWeb object directly - I'd imagine it's because I'm in
scripting-land? - and when I create a Visio.Application or Visio.Invisibleapp
object and grab SaveAsWeb out of the .addons collection none of the methods
work and the .Enabled property is false, see code below. Does anyone know if
there's a way for me to do this in VBScript?

Thanks,

banzai256




--------------------------------------------

Public Sub SaveAsWeb (VisioFile)
Dim vsoApp
Dim vsoSaveAsWeb

Set vsoApp = CreateObject("Visio.Invisibleapp")

Set vsoSaveAsWeb = vsoApp.addons.Item("SaveAsWeb")
WScript.Echo("SaveAsWeb.Enabled = " & vsoSaveAsWeb.Enabled & vbCrLf)

vsoApp.Quit
End Sub


SaveAsWeb ("C:\SaveAsWebTest.vsd")

--------------------------------------------
 
B

banzai256

Actually - the whole reason that I started off down this VBScript path is
because I couldn't find the SaveAsWeb command line tool mentioned in the
documentation. The documentation lists all of the command-line parameters
and various other information about this tool but never gives a filename or
tells you how to get the tool... I searched all through Program Files /
Office / Visio and never found an .exe that seemed to be the tool. Does
anyone know where this tool is?

I have Visio 2002 instead of Visio 2003, so maybe the tool isn't included in
2003. I definitely have the SaveAsWeb functionality though, if I open up a
document and choose Save As Web through the UI everything works properly.

banzai256
 
H

Heidi Munson [MSFT]

There is no separate command line tool. The arguments that are referred to
as "command line arguments" in the Save as web reference can be used with
Run method on Addon object for the Save as web Add-on. (And
RunAddonWArgs shapesheet function).

You can access this addon from the Addons collection which is a property of
the Visio Application object.

Dim vsoApp as Visio.Application
Dim vsoSAWAddon as Visio.Addon

' Initialized vsoApp before using it.

' Get Save as web addon from the application object.
set vsoSawAddon = vsoApp.Addons.Item("SaveasWeb")
vsoSawAddon.Run <command line arguments go here>

There is a simple vba sample code here:
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000456

-Heidi
Microsoft Corporation
This posting is provided "AS IS" with no
warranties, and confers no rights
 
Top