Connection point location based on text width

Started by YossiD, December 26, 2012, 07:32:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

YossiD

I am trying to create a text shape with a connection point located a fixed distance below the top of the shape (easy) and a fixed distance to the right of the first line of text. I want to use this shape as a master, so the connection point will have to move as the text changes.

The first line is always a one-line paragraph, and it can be shorter than the following lines/paragraphs of text in the shape. I have set the width of the shape to adjust to the text, so each line of text is always a single paragraph (i.e. no wrapping).

I'm using Visio 2003 on WinXP SP3.

wapperdude

I'm guessing that the 1st line isn't the longest line?

That makes the task difficult:
    a.) Using right justification is unacceptable?
    b.) Using the "len" function won't work because it doesn't have option to work on a per line basis
    c.) There are no 1st line of text trigger events, which makes using a macro difficult.  In fact, I think the text would have to be entered via the macro to get the "active" parsing needed.  That may not be true, but, somehow the macro would have to be triggered to exam the text and find the correct horizontal position for the connection point.

It seems that the more likely approach would be two separate text fields:  1. for the title, and 2. for the rest of the text.  Then you could use the shapesheet functions to evaluate and determine the connection point location.

Wapperdude
Visio 2019 Pro

vojo

would not it be better to insert a text transform section

So
   connection.x = textpinx <or some other constant offset> + textwidth/2
   connection.y = textpiny <or some other constant offset> + 4mm <or textheight*some scale number>

Might need to play with the constants and scale to get what you want...but I believe this would be the simplest way to do this.

aledlund

I can see two different approaches for the text segmentation that Yossi is talking about. The first would be to use character runs for the formatting (which would lead me to investigate the Character and Paragraph formatting of his text) and the multiple text boxes that Vojo suggested (the much easier approach).
al