I figured out a solution for this.
Mr. Nelson is correct that you cannot do this in the shapesheet. It looks
good one key click but bad the next.
The solution I came up with implements a macro in the drawing/template
utilizing the Document_ShapeExitedTextEdit event.
The shape is a group that has an addition shape where the text is moved to
in the edit event. This other shape is used to peform the calculations on
then the main shape is updated with the new font. This shape also scales the
font when the shape is resized too.
The calculation is based on the 12pt font and the inital length of the shape
being 1.75in. I just haven't had time to tweak the calc to support resizing
the shape and getting the text to auto-fit after that.
I have included the function and shape sheet properties.
[Main Shape]
(User-defined cells)
User.FontSize =12pt
(character)
size =User.FontSize
[Sub Shape]
(User-defined cells)
user.TextWidth =TEXTWIDTH(TheText)
User.FontSize =12pt
(character)
size =User.FontSize
transparency =100%
[ThisDocument]
Private Sub Document_ShapeExitedTextEdit(ByVal Shape As IVShape)
Shape.Shapes(1).Text = Shape.Text
If Shape.Shapes(1).CellExistsU("user.TextWidth", visExistsAnywhere) <> 0
Then
Set curTextWidth = Shape.Shapes(1).CellsU("user.TextWidth")
End If
If Shape.Shapes(1).CellExistsU("Width", visExistsAnywhere) <> 0 Then
Set curWidth = Shape.Shapes(1).CellsU("Width")
End If
curCell = "Width * 0.095"
If (curWidth < curTextWidth) Then
curCell = "Width * " & ((0.095 / (curTextWidth / curWidth) - 0.002))
End If
If Shape.CellExistsU("user.FontSize", visExistsAnywhere) <> 0 Then
Set curCellO = Shape.CellsU("user.FontSize")
curCellO.FormulaU = curCell
End If
End Sub