transfer letters in a text box on the next row only if "," character is found

Started by kiler40, January 22, 2015, 11:38:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

Dear All.
I have met an issue with one txt field i have made
In the attached file is a sample.
The field changes size based on amount of text. put in the shape data of the shape.
But it can be put bounders. Resizing the shape actually change the maximum lenght that this field can be. If the text is more long - the field become on 2 (or more) rows.
In the field are put combination separated by "," symbol.
A,A1,A2,B,C,F1, etc.
But at some point - if the size is not correct it can transfer on the next row only half identifier.
A,A1,A2,B
1,C,...

My question - can i avoid this and transferring the text on the next row to be only on "," symbol.

Hope i explain it OK :)
Thank you in advance !

Yacine

Easiest would be to add an empty space after each comma.
For both creation and further use of the string with commas and spaces, use the REPLACE function in the shapesheet.
Yacine

wapperdude

The shapesheet text parsing is limited and won't really do what you want...namely use a specific piece of text, e.g., a comma, arbitrarily placed, always needs to be at the end of a line or lines.   For Visio, this needs two things: (a) constant spaced characters, e.g., courier, and (b) some code.

You can come close, if:
   1) use a font face like courier or similar
   2) all of your constructs must be identical so that each occupies the same physical distance, e.g., A0, B9, I7,


Under those restrictions you can use the bound function to set multiple, fixed increments for the text length and guarantee the formatting.

Wapperdude
Visio 2019 Pro

kiler40

Hello Both.
Thanks for the reply.

WD - useing A0 and etc. is not an option for me :\ i have to change i don`t know on how many places this letters.
Also i don`t know witch is the biggest combinations of letters. it is a work in progress and as they can be A,B, they can be 137 identifiers split with comma :)
This is why i was thinking for something more general.

Yacine - how the emty space will give the result ? And also replace function ? i was thinking that this is used to replace a string in a sentence. can it be used to replace EVERY occurrence of the string ?

Yacine

Sorry Andrei,
It's SUBSTITUTE, not REPLACE.
I enclose a drawing in which I modified the containing shape by adding a comma+space field (check the shapesheet).
I added also a sub-shape displaying this new field.
Modifying the width of the container, will show that the 2 sub-shapes behave differently.
Adding the spaces in the string value lets Visio interpret the individual values as words and breaks the string at the right space places.
Having one single string without spaces, means that the text consists of one word. Which is broken at next best possible place without considering the commas.


Regards,
Yacine
Yacine

kiler40

this is awesome !
Thanks man :)
Where are you from :)
I`ll get you a beer (or 10) if i come to your country ! :)