OrgWiz Commands

Started by jastronomy, October 24, 2010, 08:29:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jastronomy

Hey all,

I've been pondering over this for days now and i've had just about enough :).

Right first up - all the data is stored in active directory, making full use of the 'manager' field (as we should do).
I can manually use the Visio Org Wizard; and produce nice departmental diagrams with a 'head of department' at the top of each page.

Now consider our business alone must spend 2+ weeks a year with various individuals going through spreadsheets and powerpoint blob diagrams - arrrgh.. WHY?

So.. i've setup a website (Wordpress based Intranet page), an SFTP dropoff location, tested VSD2HTML (save as web) and Scripted an FTP PUT to the server... BAM, website with up-to-date org chart HTML friendly too  :).

Final step, remove the element of human interaction! - Scheduled Task..

Here is my steps so far in automating this:
COMMAND LINE: open
COMMAND LINE PATH: c:\Program Files (x86)\Microsoft Office\Office12
ORGWIZ /MICROSOFT-EXCHANGE /MANAGER-FIELD=manager /CUSTOM-PROPERTY=title /DISPLAY-FIELDS=name,title /PAGES="ceo name" /PAGENAME="department name","manager name"

ARGS=BOLD
Values=lowercase

I'm having problems with this bit....
It does search for the names above: CEO NAME and MANAGER NAME  - complains if they don't exist.
BUT, it doesn't produce 1 page, and MANAGER NAME is NOT at the top of the page. Instead it imports everyone, and attaches one user per page :(.

Anyone successfully got this working and willing to share their command line parameters?


I have this document to support me with the argument structures http://office.microsoft.com/en-us/visio-help/make-visio-organization-charts-from-personnel-files-HA001077464.aspx
and this document to assist me after i've sorted the command + args out http://office.microsoft.com/en-us/visio-help/create-an-organization-chart-from-a-data-file-using-the-command-line-or-run-method-HP001038422.aspx.

jastronomy

I've even tried this without specifying any custom-field, or display-field... bah, it just doesn't work programatically.

Googleing around gives me nothing...

<think I need a hug>

jastronomy

ok, C# aside for now; basic as possible: VBS :D

----
I've got the following:
'Option Explicit
Dim visApp
Dim visDoc
Dim objAddOn
Dim orgWizArgs
Dim strArgs
Dim filePath
Dim Testing

Set visApp = Nothing
Testing = True
filePath = "D:\Hierarchy\"
strArgs = " /MICROSOFT-EXCHANGE /SHOW-DIVIDER-LINE" _
& " /MANAGER-FIELD=Mananer" _
& " /DISPLAY-FIELDS=Name,Title"
'& " /UNIQUEID-FIELD=Name" _
'& " /NAME-FIELD=Name" _
'& " /CUSTOM-PROPERTY-FIELDS=Name,Title,Company" _
strArgs = strArgs & " /PAGES=" _
      & chr(34) & "Director Name" & chr(34) &  " 2 PAGENAME=" & chr(34) & "Company Board" & chr(34) '_
strArgs = strArgs _
& " /CUSTOM-PROPERTY-FIELDS=Name,Title,Company" _
& " /DISPLAY-FIELDS=Name,Title,Company"

If Testing Then
Set visApp = CreateObject("Visio.Application")
Else
Set visApp = CreateObject("Visio.InvisibleApp")
End If
Set objAddOn = visApp.Addons.ItemU("OrgCWiz")
objAddOn.Run ("/S-INIT")
orgWizArgs = strArgs
objAddOn.Run ("/S-ARGSTR " + orgWizArgs)
objAddOn.Run ("/S-RUN")
Set objAddOn = Nothing
visApp.ActiveDocument.SaveAs filePath & "diagram.vsd"
visApp.Addons("SaveAsWeb").Run("/quiet=True /openbrowser=False /priformat=vml /secformat=PNG /silentmode=true /target=" & filePath & "diagram.htm")
visApp.ActiveDocument.Close
visApp.Quit
Set visApp = Nothing
UploadDiagrams
Sub UploadDiagrams
ON ERROR RESUME NEXT
Set oShell = CreateObject("WScript.Shell")
If Testing Then
oShell.Run chr(34) & filepath & "WinSCP.exe" & chr(34) & " /console /script=" _
& chr(34) & filepath & chr(34) & "WinScp-Hierarchy-Intranet.script" , 1 , true
Else
oShell.Run chr(34) & filepath & "WinSCP.exe" & chr(34) & " /console /script=" _
& chr(34) & filepath & chr(34) & "WinScp-Hierarchy-Intranet.script" , 0 , true
End If
Set oShell = Nothing
End Sub


This code does three things: constructs a single page (i can add more); and saves as a web page, then uploads using WINSCP to an SSH server.


2 ISSUES:

1) The 'JOB TITLE' is missing off every object drawn; which is weird, it does work if I use the wizard and builds the diagram perfectly.
2) This one is really messed up; some how, the 'top of the tree' doesn't get drawn; however, when I specify one name, one step down then the CEO does get drawn. EG if I enter the Name as "Mark Twain", then Frank King is at the top of the page. !?!?!

Frank King
   Mark Twain
   Sophie Swift