Visio Guy

Visio Discussions => Programming & Code => Topic started by: bazinga on November 25, 2015, 05:31:07 AM

Title: How can I set set value for properties of Shapes
Post by: bazinga on November 25, 2015, 05:31:07 AM
Hi Guys,
Visio newbie here.

The user defined cells value is read only and cannot be changed according to this microsoft page - https://msdn.microsoft.com/en-us/library/office/ff765764.aspx

My goal is to mark the shape so that I can identify it later in the code. For example, I copy a shape and move towards right. Then I repeat this for 5 times. Now I have 6 shapes. I'd like to mark all these shapes so that I can access it through some property value and group them. I cannot use the name or other existing properties because the shapes can be used somewhere in the same document.

Any ideas?

Thank you for you help.
Title: Re: How can I set set value for properties of Shapes
Post by: Yacine on November 25, 2015, 06:29:33 AM
Hi Bazinga,
If you had read the article of the mentioned link till the end, you would have found that despite CELLS is read only, it has a property FORMULA that has read/write access.
Thus: shp.cells("user.myProperty").formula=chr(34)&"something"&chr(34)

HTH,
Y.
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 48 (show)
Files included: 25 - 925KB. (show)
Memory used: 747KB.
Tokens: post-login.
Cache hits: 8: 0.00119s for 22,301 bytes (show)
Cache misses: 2: (show)
Queries used: 11.

[Show Queries]