Solved: How to change text-format of a data-graphic using the shapesheet?

Started by Nelax, December 09, 2008, 11:30:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nelax

How do I change the text-format of a data-graphic via the shape-sheet?

I want to use a macro to underline text in the data-graphic like in the attached example from the upper to the lower shape.
I have tried various cells but none of them did work as I had hoped (change value in a cell in the shape-sheet, instantly see the changed format of the text in the data graphic).

Can anyone give a hint to this?

wapperdude

In the shapesheet, go to the Character section, (you may have to add it thru right click, View Sections),  modify the Style cell value, e.g., 4 = underline, 0 = normal.  ;)

HTH
Wapperdude
Visio 2019 Pro

wapperdude

Found these links, thought they might be helpful.  They're aimed at automation, but provide some insight into text and character sections in the shapesheet.

http://blogs.msdn.com/visio/archive/2006/08/18/704811.aspx
http://blogs.msdn.com/visio/archive/2006/08/22/711391.aspx
Visio 2019 Pro

Nelax

Hi,
thanks for the reply but if I change the ShapeSheet like you say, the text, not the data-graphic-text is affected (see screenshot).

If I do the same to the ShapeSheet of the data-graphic-text, nothing happens :(

Any ideas?

wapperdude

In your case, the way that you manage the text puts the "foo bar" in an embedded shape.  You must push down to get to its shapesheet, then, the character manipulation will work.  If you select the "foo bar", bring up its shapesheet, that will work.  You can either push or pull the style value from the toplevel thru use of formulas.
Visio 2019 Pro

Nelax

I thought so too, but if I change the style from 0 to 4 (normal to underline) nothing happens.

If I change the text via the button for textformatting (like CTRL+u) the style gets changed to 4 and the text is underlined...

I really don't get where visio changes the styla also or does some black magic to alter the text :(

ideas?

wapperdude

It works, really!!!  You have to use the correct shapesheet.  For the file I downloaded, the upper shape without the foobar underlined, the correct shapesheet is sheet.3.  You can easily see the nesting if you bring up the Drawing Explorerer window (DEW) (menu bar>View>Drawing Explorerer).  Click foreground pages > Shapes > and keep expanding until the tree is fully exposed.  Click on Sheet.1, and that should show your shape as selected.  This is where you could place your initial formula, and is probably where you've been changing the style cell value.  But, now click on sheet.3, that ought to be the last one in this tree.  Notice the shape selection looks differently.  This is the shape where "foo bar" resides.  In the DEW, right click shape.3 and open the shapesheet.  Now change the style cell.  Foobar will underline.  So, to mechanize this, the shape.3 style cell must either reference the shape.1 instruction.  You can push the value down, so that shape.1 formula references shape.3 style cell, or pull the value in, such that shape.3 style cell references the shape.1.

Push: e.g., shape.1 has a user defined cell entry which you create with:  shape.3!SETF(GetRef(Char.Style),4)
Pull:  e.g., in the shape.3 style cell, enter something like:  shape.1!(user.mystyle), where "mystyle" is name of the row in the user defined cells in shape.1.


Visio 2019 Pro

Nelax

awww FINALLY!

thank you so much :) I was always fiddling around with the text-callout and not the shape for the text...

works like a charm now. I pull the value for the char.style from the parent shape:

in shape 3, char.style got the following formula:

=Sheet.1!Char.Style

thanks :)

wapperdude

Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 283 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1124KB.
Tokens: post-login.
Cache hits: 13: 0.00130s for 26,610 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]