Howdy folks,
I'm trying to determine the easiest way to dynamically change the font size of shape text. I want my text to be as large possible without flowing outside the shape.
Context:I have about 60 shapes on a page. I have the same case-statement macro assigned to double-clicking all the shapes. Depending on which shape you double click, the corresponding case executes. I use this case to populate the .Characters of my "table" (a bunch of rectangle shapes arranged like a table) Ultimately, the values that I'm using to populate the .Characters of my table are user-inputs from a separate macro, so they can be as short as one word or as long as several sentences.
Dilemma:I'd like the text that populates my table to be as large as possible without overflowing out of the shapes. Is there an easier way to do this other than something like...
a. measuring the length of the string (I assume there is an easy way of counting characters)
b. assigning different font sizes to different ranges of string lengths (another case statement)
c. saving the appropriate font size as a variable, including a line in each case to set the shape's font size to that variable
Here is some code to help picture what I'm doing:
'Gets shape you double click on
Dim Sel As Visio.Selection
Set Sel = ActiveWindow.Selection
Dim shp As Visio.Shape
Sel.IterationMode = 0
Set shp = Sel.PrimaryItem
'Executes code appropriate for that shape (populates table with the correct values)
Select Case shp.Name
Case "Shape1"
'code here
Case "Shape2"
'code here
' .....
Case "Shape60"
'code here
End Select