Visio Guy

Visio Discussions => Visio 2013 Issues => Topic started by: AndrewJ on July 05, 2013, 03:36:23 PM

Title: Macro recording fail
Post by: AndrewJ on July 05, 2013, 03:36:23 PM
Hello!

I am trying to record a Macro in order to extract a code for creating a new data graphic (I want to automate the creation of little orange circles on top of process boxes in order for them to display process numbers).
However, when I start recording the macro, the data graphic options get greyed out.

1: What can I do to get around this?
2: How can I figure out the code to do this if I can't record a macro and then analyze the results? (I have already checked the SDK and couldn't find this)
3: Why is this happening? It's ridiculous!

Thanks in advance!
Title: Re: Macro recording fail
Post by: AndrewJ on July 05, 2013, 04:17:30 PM
Just to give you guys an idea, this is what I am trying to record in a macro and avoid having to get the employees to do manually every single time they want to number a process box, especially since boxes might be added after the initial numbering is done.
My instructions were as follows...

1: CTRL click all processes that will be numbered
2: DATA tab > Data Graphics > Create New Data Graphic > New Item...
3: In the New Item window, select:
   Data Field: More Fields > Shape Data > Process Number (then click OK)
   Displayed as: Text
   Style: Circle callout
   Value Format: @+   
   Value Length: 10
4: Click OK
5: Under Default position, select:
   Horizontal: Left Edge
   Vertical: Top Edge
6: Click OK
7: Click "Yes" to apply this data graphic to selected shapes
Title: Re: Macro recording fail
Post by: aledlund on July 05, 2013, 04:30:50 PM
I'd start by getting a copy of David Parker's book

http://www.amazon.com/Visualizing-Information-Microsoft%C2%AE-Office-Visio%C2%AE/dp/007148261X/ref=sr_1_2?s=books&ie=UTF8&qid=1373041794&sr=1-2&keywords=david+parker+visio

al
Title: Re: Macro recording fail
Post by: AndrewJ on July 05, 2013, 04:35:43 PM
Thank you,

But is there any help anyone is willing to offer me for this short of having to purchase and read an entire book?
Any help would be much appreciated, either in figuring out how to get Visio to stop greying out what I'm trying to record through a macro, by telling me how I can extract this code otherwise or by telling me what code to use if you could be that generous.

By the way, I am using Visio 2013.
Title: Re: Macro recording fail
Post by: aledlund on July 06, 2013, 01:05:39 PM
You might start here ( the assumption is that you already have the visio sdk)

http://msdn.microsoft.com/en-us/library/office/ff766215.aspx

al
Title: Re: Macro recording fail
Post by: AndrewJ on July 08, 2013, 03:14:37 PM
Thank you.
But from what I am reading, it means that I have to already have created a data graphic?
That defeats the purpose of what I am trying to accomplish since you can simply select all shapes and chose the data graphic and it's done.
What I am trying to accomplish programmatically is creating that data graphic programmatically and integrating that code into a macro.
Can that be done?