Author Topic: Keeping text within the text box  (Read 4690 times)

0 Members and 1 Guest are viewing this topic.

ald20

  • Newbie
  • *
  • Posts: 3
Keeping text within the text box
« on: October 18, 2013, 10:09:13 AM »
I grouped some shapes together and I edited the main text box associated with the group. I positioned it where I wanted it to be and set the size of the text box.

Now I want the text to be truncated if it goes outside of the box. I don't want to use TRUNC because that is a set number of characters and depending on what is entered as text that number could vary. ie. all caps would be less characters than all lower case. What I want is for the text to fill a certain amount of space, then be truncated. 

Thanks,
Art

kiler40

  • Sr. Member
  • ****
  • Posts: 328
Re: Keeping text within the text box
« Reply #1 on: October 19, 2013, 10:09:34 AM »
Hello ald20

Is this what you mean ?

http://visguy.com/vgforum/index.php?topic=5011.0

vojo

  • Hero Member
  • *****
  • Posts: 1515
Re: Keeping text within the text box
« Reply #2 on: October 19, 2013, 08:00:49 PM »
could do the following

user.basesize = <size of group or text box when created....might be the width....say 20mm>
user.scale  = <current width or whatever> / user.basesize                 //this should be a number with no units
fontsize = 10pt * user.scale

So as the textbox or group (which ever you picked as base) shrinks....font shrinks

ald20

  • Newbie
  • *
  • Posts: 3
Re: Keeping text within the text box
« Reply #3 on: October 21, 2013, 06:07:54 AM »
Thanks for the replies.

I don't want the font to shrink, I just want to only display the text that can fit within the constraints of the text box.

vojo

  • Hero Member
  • *****
  • Posts: 1515
Re: Keeping text within the text box
« Reply #4 on: October 21, 2013, 09:01:41 AM »
wow...poor mans encryption....who knew???

Seriously, not sure of the benefit of text fragments.
You might be better off doing something like this
   - Have a key word in one user cell
   - Have a description in another
   - Have a cell to conditionally merge them

something like

user.key = <keyword>
user.desc = <description or more text>
user.combo = user.key + " " + if (textbox_size > xmm, user.desc,NA)

insert user.combo into shape fiel insert fields on insert panel

obviously, can take this to the extreme for every N characters....but not sure the point of that.


wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3822
  • Ideas Visio-lized into solutions
Re: Keeping text within the text box
« Reply #5 on: October 21, 2013, 10:10:59 AM »
Do not believe there is anyway to do the truncation within the shapesheet. 

Might be done in VBA.  Perhaps by working with characters.  It would take some development effort though.  Somehow you'd need to determine when, for example, the 1st linefeed would trigger and prevent it and all subsequent linefeeds from happening.  At the same time, you also need to either make the additional characters invisible or set to zero size.  This assumes that you want to see the entire text at some point in time. 

Wapperdude
« Last Edit: October 21, 2013, 10:14:33 AM by wapperdude »
Visio 2019 Pro

vojo

  • Hero Member
  • *****
  • Posts: 1515
Re: Keeping text within the text box
« Reply #6 on: October 21, 2013, 03:32:26 PM »
One last thought

You could mess with the condense cell in font section.   I suspect though, that too much condensing makes the text look like
the matrix characters.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3822
  • Ideas Visio-lized into solutions
Re: Keeping text within the text box
« Reply #7 on: October 21, 2013, 04:18:32 PM »
OK.  Ran across this article that Visio Guy did.  Looks like it'll do exactly what you want:  http://www.visguy.com/2008/02/11/lorem-ipsum-%E2%80%93-visio-ia-text-placeholder-shape/

HTH
Wapperdude
Visio 2019 Pro

ald20

  • Newbie
  • *
  • Posts: 3
Re: Keeping text within the text box
« Reply #8 on: October 22, 2013, 05:46:57 AM »
OK.  Ran across this article that Visio Guy did.  Looks like it'll do exactly what you want:  http://www.visguy.com/2008/02/11/lorem-ipsum-%E2%80%93-visio-ia-text-placeholder-shape/

HTH
Wapperdude

Thanks wapperdude, that was exactly what I was looking for!