VBA-Is there a way to stop text wrapping?

Is there a way to stop text from wrapping in a text box?

I have a macro that automatically imports names into text boxes.  As shown in the image below, I want FirstName, Middle, and Last each on separate lines.  When one of the names is fairly long, the name wraps to the next line. I tried "fit text to frame" but that does not work.

If I could disable the text wrap, then I can simply use VBA logic so that if the text overflows the text box, then reduce the font size until it doesn't overflow.  Any ideas?

Parents
No Data
Reply
  • That sort of text wrapping has never made sense to me. I would prefer to get some sort of visual feedback indicating that the paragraph text frame is too narrow. Those kind of breaks do crazy things for people who are trying to flow text (e.g. lists of names) into irregularly-shaped frames, too.

    I'm just spitballing here, but if you have access to the individual parts of the name (first, middle, last), then perhaps you could do something like this:

    1. Create Artistic Text shapes for each part of the name (first, middle, last). So, three independent text shapes.
    2. See which of those shapes has the greatest width.
    3. Scale that shape proportionately to get it to the target width.
    4. See what the font size is.
    5. You might (I'm not sure; haven't tried) have to reduce that font size a little bit to be sure that it doesn't wrap when used in a Paragraph Text frame.

    It's possible to do stuff like that with "virtual" shapes rather than "real" shapes, so they don't show up in the undo list.

Children
No Data