D
Don
Hi everyone...
I am looking for the missing link here - I have build Orgcharts using Excel
input files, and I was quite capable of doing this using the Command Line
Method.
The only problem was that I was not able to set the template for the webpage
and also, there is no easy way to save as HTML.
I rewrote most of the code in VBA but I am not sure how to invoke the macro
that runs the orgchart wizard. I have set up the parameters, and all I need
is the command to execute the wizard, and pass the args. I am including the
code I have wrote, there is a section that needs to be created where the
application (wizard) is invoked.
Regards
Don
code:
Public Sub Create_Model()
Dim docObj As Visio.Document
Dim runObj As Visio.Document
' these settings are for the orgchart wizard.
Const orgCWiz As String = "ORGANIZATION_CHART_WIZARD"
Const SFILE As String = "/FILENAME=Model Vision\test file.xls"
Const HLINK As String = "/HYPERLINK-FIELD=Hyperlink"
Const CFLDS As String = "/CUSTOM-PROPERTY-FIELDS=Program,Business
Group,Record Count"
Const DFLDS As String = "/DISPLAY-FIELDS=Program,Business Group,Record
Count"
Const NmFLD As String = "/NAME-FIELD=Model"
' these settings are for saving the file as HTML - change the name of the
file below in targetpath
Dim saveAsWeb As IVisSaveAsWeb
Dim webSettings As IVisWebPageSettings
Set saveAsWeb = New VisSaveAsWeb
Set webSettings = saveAsWeb.WebPageSettings
webSettings.StartPage = 1
webSettings.EndPage = 2
webSettings.LongFileNames = True
webSettings.SilentMode = True
'Open a new document based on a template.
Set docObj = Documents.Add _
("c:\Program Files\Microsoft Office\Visio10\1033\Solutions\Organization
Chart\Model Vision.vst")
'run the org chart wizard.
'
' !!!!!!!!!!!! help is needed here !!!!!!!!!
' save the file
webSettings.TargetPath = "c:\Model Vision\m10279.htm"
saveAsWeb.CreatePages
End Sub
I am looking for the missing link here - I have build Orgcharts using Excel
input files, and I was quite capable of doing this using the Command Line
Method.
The only problem was that I was not able to set the template for the webpage
and also, there is no easy way to save as HTML.
I rewrote most of the code in VBA but I am not sure how to invoke the macro
that runs the orgchart wizard. I have set up the parameters, and all I need
is the command to execute the wizard, and pass the args. I am including the
code I have wrote, there is a section that needs to be created where the
application (wizard) is invoked.
Regards
Don
code:
Public Sub Create_Model()
Dim docObj As Visio.Document
Dim runObj As Visio.Document
' these settings are for the orgchart wizard.
Const orgCWiz As String = "ORGANIZATION_CHART_WIZARD"
Const SFILE As String = "/FILENAME=Model Vision\test file.xls"
Const HLINK As String = "/HYPERLINK-FIELD=Hyperlink"
Const CFLDS As String = "/CUSTOM-PROPERTY-FIELDS=Program,Business
Group,Record Count"
Const DFLDS As String = "/DISPLAY-FIELDS=Program,Business Group,Record
Count"
Const NmFLD As String = "/NAME-FIELD=Model"
' these settings are for saving the file as HTML - change the name of the
file below in targetpath
Dim saveAsWeb As IVisSaveAsWeb
Dim webSettings As IVisWebPageSettings
Set saveAsWeb = New VisSaveAsWeb
Set webSettings = saveAsWeb.WebPageSettings
webSettings.StartPage = 1
webSettings.EndPage = 2
webSettings.LongFileNames = True
webSettings.SilentMode = True
'Open a new document based on a template.
Set docObj = Documents.Add _
("c:\Program Files\Microsoft Office\Visio10\1033\Solutions\Organization
Chart\Model Vision.vst")
'run the org chart wizard.
'
' !!!!!!!!!!!! help is needed here !!!!!!!!!
' save the file
webSettings.TargetPath = "c:\Model Vision\m10279.htm"
saveAsWeb.CreatePages
End Sub