News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Macro API

Started by Toaster, May 18, 2009, 05:25:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Toaster

I am power office user and software developer; so I have written a few macros in my time.  I have found the visio API to be somewhat complicated.
It seems that the API design tradeoff was for cpu efficiency over usability -- some of us would rejoice if a second, simpler, more intuitive (from an average user's pov) API could be provided for those of us who just want to bang out a macro now and then.

Visio Guy

#1
Hi Toaster,

The API starts to get simpler if you understand the ShapeSheet--which isn't simple.

You can do a huge number of things once you understand that you need to get into the cells of a shape, ie:

shp.Cells("Width").ResultIU = 2.5
shp.Cells("User.myData").FormulaForce = "" & "One;Two;Three" & ""

But I agree with you: a programmer has to go to deep to get Visio to do anything.

It would be nice to have simpler, more intuitive operations like shp.FillColor = Colors.Red or shp.TextBehavior = SizeWithShapeHeight, etc.

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Toaster

Thanks, I will take a closer look at ShapeSheet next time I roll up my sleeves to write a macro. 
Sometimes the right starting point can make a big difference. :)

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 178 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1054KB.
Tokens: post-login.
Cache hits: 13: 0.00178s for 26,726 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]