|
|
|
|
|
|
Visio
|
Change the font size of all shapes at once
|
|
Ease of Use
|
Easy
|
Version tested with
|
2003
|
Submitted by:
|
Brandtrock
|
Description:
|
Change the font on all shapes in a Visio document page.
|
Discussion:
|
Standardizing the font size on a Visio project that many persons have had input to can be time consuming. This routine will change all text in shapes to 12pt font.
|
Code:
|
instructions for use
|
Option Explicit
Public Sub FontChange()
Dim shpObjs As Visio.Shapes
Dim shpObj As Visio.Shape
Dim celObj As Visio.Cell
Dim i As Integer
Set shpObjs = ActivePage.Shapes
For i = 1 To shpObjs.Count
Set shpObj = shpObjs(i)
Set celObj = shpObj.Cells("Char.Size")
celObj.Formula = "=12 pt."
Next
Set celObj = Nothing
Set shpObj = Nothing
Set shpObjs = Nothing
End Sub
|
How to use:
|
- Open your Visio document.
- Press Alt + F11 to launch the Visual Basic Editor (VBE).
- Select Insert>Module from the Menu Bar in the VBE.
- Copy the code from above.
- Paste the code in the right hand window of the VBE.
- Close the VBE.
- From the Visio document, select Tools>Macro>Macros (or press Alt + F8).
- Highlight FontChange in the list of macros.
- Press run.
|
Test the code:
|
- Open the example file.
- Run the FontChange macro per the instructions above.
- When you are convinced that it works right, place the code in your document and run it.
|
Sample File:
|
VBAX_Visio3.zip 96.56KB
|
Approved by mdmackillop
|
This entry has been viewed 65 times.
|
|