Visio Guy

Visio Discussions => Programming & Code => Topic started by: chelmite on August 12, 2018, 08:48:35 PM

Title: How to set ShapeText from Shape Data?
Post by: chelmite on August 12, 2018, 08:48:35 PM
Hi. Certain shapes have shape data:
DevType
Room
DevNum
RequiresPower

I want to:
I think the bounding box part is easy...it appears to go in LineFormat.LineColor.
Where do I set TheText?
Title: Re: How to set ShapeText from Shape Data?
Post by: Nikolay on August 12, 2018, 10:22:20 PM
You can try "insert field" (Insert => Field => Formula)
Title: Re: How to set ShapeText from Shape Data?
Post by: chelmite on August 12, 2018, 11:17:44 PM
On what object/shapesheet/shapesheet category am I inserting this field?
Title: Re: How to set ShapeText from Shape Data?
Post by: Nikolay on August 13, 2018, 12:16:58 AM
It's in the menu (tab "Insert"), you don't need shapesheet for that.
https://support.office.com/en-us/article/insert-a-text-field-into-a-shape-0225c22e-3e5e-4ea7-9ca0-1ec91386cb1e
Title: Re: How to set ShapeText from Shape Data?
Post by: chelmite on August 14, 2018, 08:44:51 AM
Thanks!

Now...is there a way to get more than one displayed. I tried "adding" another text field, but it replaced the first one.
Title: Re: How to set ShapeText from Shape Data?
Post by: Nikolay on August 14, 2018, 10:27:06 AM
Yes, you can add as many fields as you want..
First select the shape, then start text editing (hit F2), and then use this command.

Alternatively, use Insert Field, "Custom Formula", and type full formula in the input box.
Title: Re: How to set ShapeText from Shape Data?
Post by: wapperdude on August 14, 2018, 07:50:19 PM
To clarify what Nikolay said, after you insert field, go back to the shape, then, in text mode, place cursor at end of inserted field...hit return to move to start another line. Then, go and do another Field insert.  Note, make sure no text is selected when you do this.  You're merely placing the cursor where you want the next insert to occur.

Wapperdude