Reputation: 3
I can change the font, color, size of characters in the shape. But only for rows that already exist in the VisSectionIndices.visSectionCharacter of shapesheet.
I cant create new rows for this section and cant change the number of characters for each formatting.
Any solution will suit me. Any hack, any idea.
I already broke my head, I don't know how to approach this.
How do I change the color of the text inside one shape? (For example black green red?)
Upvotes: 0
Views: 1155
Reputation: 12235
Welcome to stackoverflow. You could check some visio book, like "Developing Visio Solutions" free microsoft book, it discusses these subjects.
There is also a great Visio forum, http://visguy.com/vgforum/ where you can find lots of visio-specific question answered out of the box. Russian visio related forum forum: https://visio.getbb.ru/
Also, you can always use macro recorder to generate the code (I mean, you turn on the recording, do the action manually, and get the generated code in the VBA IDE)
Anyways. You can use shape.Characters
to modify style of a text fragment. Like this:
Set shp = ActivePage.DrawRectangle(0, 0, 1, 1)
Set chars = shp.Characters
chars.Text = "Something with Red Text"
chars.Begin = 10
chars.End = 19
chars.CharProps(visCharacterColor) = 2
Result:
Upvotes: 2