This may have been asked before but I could not find a specific answer so here goes... I have a custom text formula:
=INT(TxtWidth*8)*1 pt
I use this to dynamically resize text as needed. I think I found that solution here. Anyway, I would like to take this attribute and apply it to a lot of text without having to go through each text box or shape individually and right click... Show ShapeSheet... Copy/Paste into the Size box. There are literally thousands of these text boxes and this seem too labor intensive.
Any suggestions?
changing the formula of a cell is as easy as
shp.CellsSRC(visSectionCharacter, 0, visCharacterSize).FormulaU = YOURFORMULA
The question is which shapes need to be changed.
1) All?
then
for each shp in activepage.shapes
DOTHECHANGE
next shp
Here are some more options:
http://visguy.com/vgforum/index.php?topic=5802.msg23260#msg23260 (http://visguy.com/vgforum/index.php?topic=5802.msg23260#msg23260)
2) shapes defined by some cell value
Make sure that the cell exists, then check its value
For Each shp In ActivePage.Shapes
If shp.CellExists("prop.something", visExistsAnywhere) Then
if shp.Cells("prop.something", visSectionProp).ResultStr(visNone)=YOURIDENTIFICATOR then
DOTHECHANGE
endif
End If
Next shp
3) shapes that you want to select one by one
Create a non-modal form and catch new selections by means of the following procedure
Add a checkbox so you can pause the assigning.
Private WithEvents winObj As Visio.Window
Private Sub winObj_SelectionChanged(ByVal Window As IVWindow)
Dim shp As Visio.Shape
Dim sel As Visio.Selection
Set sel = ActiveWindow.Selection
sel.IterationMode = visSelModeSkipSuper
If sel.Count > 0 And CheckAktiv.value Then
Set shp = sel(1)
setValue shp
End If
End Sub
4) All shapes in a selection can be accessed by
for each shp in activewindow.selection
HTH
It will be just for selected text blocks and objects with text properties. I was trying to go the macro route but that did not seem to be the solution. I'll give this a shot. Attached is part of the diagram in question. The Interface 1
Input has the correct text resizing code. The others do not.