Running Visio Org Chart Wizard from a macro with file specifying page layout

Started by WCTICK, February 15, 2024, 02:18:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WCTICK

Hi,

I currently use a macro from within a blank Visio Org chart to use data from the selected Excel spreadsheet to create a new Org Chart using the parameters specified.  A portion of the code is shown below where specific parameters are defined.

Currently, it is using the option of having the wizard automatically break the chart across pages.

I would like to change that so I can specify how to break it, using data from an input file. When manually specifying the page breaks, you must enter the top executive, levels of subordinates to display and a page name.  Rather than manually inputting that, I would like it to be obtained from a file.

Does anyone know if this is possible and if so, a recommended method to do it?

I've attached a file that shows the selection pages the wizard displays when specifying the info manually.  Thank you for any assistance you can provide.


'Add org chart arguments, including Excel filename
    sOrgWizArgs = _
          "/FILENAME=" & sFullPath _
        & "/NAME-FIELD=""Employee Name"" " _
        & "/MANAGER-FIELD=""Reports to - Position"" " _
        & "/DISPLAY-FIELDS=""Employee Name"",""Job Code Title - Position"",""Position Number"" " _
        & "/CUSTOM-PROPERTY-FIELDS=Department,Name,Title,""Avanade Relationship Owner"",""Current Status"",""Social Style"",Coach,""Competitor Relationship Strength"",""Key Decision Maker"" " _
        & "/SYNC-ACROSS-PAGES " _
        & "/HYPERLINK-ACROSS-PAGES "
        ' unused parameters
        '& "/SHOW-DIVIDER-LINE " _
        '& "/PAGES " _
        ''& "/LAUNCHGUI"
   
    ' set the arguments and...
    objAddOn.Run ("/S-ARGSTR " + sOrgWizArgs)
    ' ...run the wizard to create an org chart within this document
    objAddOn.Run ("/S-RUN /cmd=AddToOldDrawing")