S
SK
Hi All ,
I've wrote a VB script to read a file and create a org chart in VISIO 2003
.. Does it work ? - YES and NO ... Here is the issue I have :
After installing Visio 2003 , the first time I ran my script , it created 16
pages (one for each box) instead of all the information in one page . Trying
out several things , I took the same input file and ran the wizard manually
and all the information came out in one page .. just as I wanted . Now when I
run my script again , it worked perfectly .. displaying all the information
in just one page . I'm thinking there is some setting that is being turned on
when I run the wizard manually ... My issue is : When I run this scrip on a
NT server through anothe program , VISIO process is kicked off as SYSTEM and
it generates different pages again . If I logon to the server and run it
with my local user ID it works fine when I do the two steps(1- run the
wizard manually and 2- run using the script).
Is there any setting that I am missing ??
Any suggestions are greatly appreciated.
Here is the script :
Dim objVisio , wb
Dim objAddOn , ws
'START THE ORG CHART WIZ
Set objVisio = CreateObject("Visio.Application")
objVisio.Visible = false
Set objArgs = WScript.Arguments
strFile = objArgs(0)
objVisio.Visible = false
Set objAddOn = objVisio.Addons.ItemU("OrgCWiz")
objAddOn.Run("/S-INIT")
' add your arguments
strCommandPart = " /DISPLAY-FIELDS=Name,Position /FILENAME= " & strFile
objAddOn.Run("/S-ARGSTR " + strCommandPart)
'Run the wizzard
objAddOn.Run("/S-RUN")
objVisio.Addons("SaveAsWeb").Run "/quiet=True /target=C:\temp\test.htm
/startpage=1 /endpage=1 "
objVisio.ActiveDocument.SaveAsEx "c:\temp\filename.vsd", visSaveAsRO
' Save the document
objVisio.ActiveDocument.SaveAsEx(strNewFile, 2 + 4)
objVisio.Quit()
I've wrote a VB script to read a file and create a org chart in VISIO 2003
.. Does it work ? - YES and NO ... Here is the issue I have :
After installing Visio 2003 , the first time I ran my script , it created 16
pages (one for each box) instead of all the information in one page . Trying
out several things , I took the same input file and ran the wizard manually
and all the information came out in one page .. just as I wanted . Now when I
run my script again , it worked perfectly .. displaying all the information
in just one page . I'm thinking there is some setting that is being turned on
when I run the wizard manually ... My issue is : When I run this scrip on a
NT server through anothe program , VISIO process is kicked off as SYSTEM and
it generates different pages again . If I logon to the server and run it
with my local user ID it works fine when I do the two steps(1- run the
wizard manually and 2- run using the script).
Is there any setting that I am missing ??
Any suggestions are greatly appreciated.
Here is the script :
Dim objVisio , wb
Dim objAddOn , ws
'START THE ORG CHART WIZ
Set objVisio = CreateObject("Visio.Application")
objVisio.Visible = false
Set objArgs = WScript.Arguments
strFile = objArgs(0)
objVisio.Visible = false
Set objAddOn = objVisio.Addons.ItemU("OrgCWiz")
objAddOn.Run("/S-INIT")
' add your arguments
strCommandPart = " /DISPLAY-FIELDS=Name,Position /FILENAME= " & strFile
objAddOn.Run("/S-ARGSTR " + strCommandPart)
'Run the wizzard
objAddOn.Run("/S-RUN")
objVisio.Addons("SaveAsWeb").Run "/quiet=True /target=C:\temp\test.htm
/startpage=1 /endpage=1 "
objVisio.ActiveDocument.SaveAsEx "c:\temp\filename.vsd", visSaveAsRO
' Save the document
objVisio.ActiveDocument.SaveAsEx(strNewFile, 2 + 4)
objVisio.Quit()