I have the task to implement a function in a web application that creates orgcharts in Visio and Powerpoint (Intranet environment).
What I do so far:
In the Web application the user defines some filter critera and clicks on "Create Orgchart"
a vbs script is created that is downloaded by the user and executed on the user's desktop
this vbs-script creates an Excel file with the orgchart data on the user's desktop.
it than creates a Visio file and runs the orgchart-addon in order to build the orgchart.
So far, so good, evething works fine, the users have created many fine orgcharts and everybody is smiling.
Now they want to get these orgcharts into Powerpoint slides as much automated as possible.
I added the following after the orgchart is finished in my vbs-script:
I create a powerpoint object and load a template file
In Visio, I loop all pages
for each page I select all content (Orgchart) and copy it to the clipboard
Then I add a new slide in powerpoint and paste the orgchart into that slide
aftre doing some finetuning (resizing, positioning), the Powerpoint presentation contains as many slides as the visio file has pages and all orgcharts are copied over
And here comes the problem:
when I run the orgchart-wizard in my vbs-script, it starts that addon in visio.
But than the vbs-script moves to the next command even if the orgchart has not finished.
That leads to the following:
The orgchart-wizard not only creates the orgcharts on the specified pages in visio, but it also takes care of formatting them properly: shapes are rezised and positioned so that ithey look fine.
But the vbs-script continues with the Powepoint-part at once
, before the formatting is ready so that the orgcharts that are copied over to Powerpoint are ugly :-(
Depending on the selected criteria, the orgchart-wizard takes some seconds or a minute,
If I try to wait some time using WScript.sleep 10000, the orgwiz halts and does not continue the formatting job...
Question: how can I tell the vbs-script to wait until the wizard has finished?
Or: what other method could I use to move the orgcharts over to Powerpoint?
Thanks a lot!