Author Topic: Macro API  (Read 3520 times)

0 Members and 1 Guest are viewing this topic.

Toaster

  • Newbie
  • *
  • Posts: 7
Macro API
« on: May 18, 2009, 12:25:27 AM »
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.
« Last Edit: May 18, 2009, 12:39:40 AM by Toaster »

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1716
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Macro API
« Reply #1 on: May 18, 2009, 09:28:53 AM »
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.

« Last Edit: May 18, 2009, 09:31:12 AM by Visio Guy »
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

  • Newbie
  • *
  • Posts: 7
Re: Macro API
« Reply #2 on: May 18, 2009, 12:56:35 PM »
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. :)