passing parameters to a batch file called from a visio hyperlink

Started by phanes316, May 02, 2018, 01:04:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phanes316

I'm new to this forum - not necessarily new to visio - using visio 2010  --  Network diagramming I can retrieve significant amounts of information from batch files called via the shapes hyperlink.  Rather than writing a batch file for each shape I want to pass the shape network designation to a single batch file.  I can do this from a command line but the visio hyperling tries to parse the entire line (including the parameter) as a single filename - which then fails.

Any suggestions would be greatly appreciated.

Yacine

Hyperlinks seem not to be suitable for passing parameters.
You can however call a macro from your shape and pass it the necessary data.

The call from the shape is done via the CALLTHIS function.
In the macro, you would write something like: Call Shell("C:\Test.bat" & " " & theParameter, vbNormalFocus).
TheParameter being the shape ID (ship.ID() ), or an arbitrary cell e.g. shp.cells("myProp").resultstr("")
Yacine

phanes316

Yacine - thanks for the reply and while I can make a macro function in the visio page - my ultimate goal is an html output and everything that I can find indicates macros are not supported in the html output.

Yacine

Nikolay has written a cool tool for exporting a drawing into SVG/HTML+Javascript. You can add custom behaviour to individual shapes, so as to get your linking problem solved.
http://visguy.com/vgforum/index.php?topic=7642.0
Yacine

Nikolay

There is a specific example for starting command line tool (putty/ssh to shape's IP address)
http://unmanagedvisio.com/starting-putty-from-an-exported-html-diagram/

There was also a topic on this site about PING, I believe, but could not find it on the spot.

Please note that the export tool is not required to implement the approach described in the above article, you can go just with application protocol, if you specify all your links manually. If you want to use shape data to build the link, then the tool can help.

phanes316

Perhaps I should explain my complete project goal and the current roadblocks encountered to more clearly define the required outcome.

Additionally,  I tried to create an SVG output but the process would never complete - it appears to have gotten like 99% and then the application would freeze and I was required to kill and restart. (This I tried multiple times all with the same result)

My network documentation project has a twofold intent, to gather in one place as much IT related information as I can provide, and to make that repository a working tool for IT personnel to use. (running from a web page - as this precludes having to purchase a lot of visio licenses and to exposing the source file to constant manipulation as well as providing a universal platform for accessing and utilizing the tool)

My initial request to pass arguments to batch files was predicated on having developed batch files for all the process I can currently utilize remotely - but not wanting to have to make a massive duplication effort of those same batch files for all the objects in the document.  If I could pass arguments I would need only one batch file per process and just pass the relevant information from the shapes hyperlink call to the batch file.  Unfortunately that does not appear to be viable.

The macro suggestion was excellent as I am also a seasoned VBA programmer - but alas the macro function is (at least in all documents that I could find - not supported in the html output)

Additional difficulties I have encountered - the xaml output while supporting the pan and zoom does not support multiple hyperlinks per shape.  The VML output overcame this obstacle but I cannot get the pan and zoom to operate properly in this format output.  This has resulted in having to place icon groupings around the shape to provide the hyperlink to the other processes.  This is now creating a crowding output as having to place this icon grouping around all the shapes is limiting.

There is a brief synopsis of what I am hoping to create and the current hurdles faced in getting there.