I'm using Access to call Visio and generate organization charts (using Visio's Org Chart Wizard) and then us the SaveAsWeb method to save the file as a set of web pages.
As long as my target is on a "normal" drive (i.e. "k:\mydrive\Org Chart.htm") things work fine. As soon as I change the target to one of the folders on our intranet, I get an error message that the path name is invalid.
I thought I'd be able to use:
/TARGET=//pashanet/hr/TotalRewards/Drawing5.htm
but it's not working. Any thoughts???
As long as my target is on a "normal" drive (i.e. "k:\mydrive\Org Chart.htm") things work fine. As soon as I change the target to one of the folders on our intranet, I get an error message that the path name is invalid.
I thought I'd be able to use:
/TARGET=//pashanet/hr/TotalRewards/Drawing5.htm
but it's not working. Any thoughts???
Code:
Sub Generate()
Dim VisApp As Object
Dim visDoc As Visio.Document
Dim visExcelFile As String
Dim objAddOn As Object
Dim objAddOn2 As Object
Dim orgWizArgs As String
'Export data file from access and save as Excel file
DoCmd.OutputTo acOutputTable, "TblOrgChart", acFormatXLS, "K:\HR-Payroll\HR\HRIS\OrgChart.xls"
'Assign file location of Excel file that feeds into Visio
visExcelFile = "K:\HR-Payroll\HR\HRIS\OrgChart.xls"
'START VISIO'S ORG CHART WIZARD
Set VisApp = CreateObject("Visio.Application")
Set objAddOn = VisApp.Addons.ItemU("OrgCWiz")
objAddOn.Run ("/S-INIT")
'Add org chart arguments
orgWizArgs = " /FILENAME=" & visExcelFile & " /NAME-FIELD=NAME /MANAGER-FIELD=SupID /DISPLAY-FIELDS=Name, Title /CUSTOM-PROPERTY-FIELDS=Title,Location HIDDEN /SHOW-DIVIDER-LINE /SYNC-ACROSS-PAGES /HYPERLINK-ACROSS-PAGES" 'fill in args here
objAddOn.Run ("/S-ARGSTR " + orgWizArgs)
'Run the wizard
objAddOn.Run ("/S-RUN")
'Save the document as a web page
Set objAddOn2 = VisApp.Addons.ItemU("SaveAsWeb")
'Add the Web Page Arguments/Preferences
objAddOn2.Run "/QUIET=True /NAVBAR=False /SEARCH=true /TARGET=//pashanet/hr/TotalRewards/Drawing5.htm"
'Quit Visio and close everything out
VisApp.Quit
Set VisApp = Nothing
End Sub
Comment