title: Visio VBA: How to make all text in Org Chart Bold
body: <p>I would like to simplify updating my orgcharts in Visio.  So far I have a macro borrowed from here <a href="https://bvisual.net/2010/01/28/applying-selected-datagraphic-to-the-whole-document/" rel="nofollow noreferrer">https://bvisual.net/2010/01/28/applying-selected-datagraphic-to-the-whole-document/</a> and written out below.  I would like to adapt it to make some changes to the format of the text withing shapes e.g. to make the font bold and potentially to change it's colour.  I'm finding it really difficult to find examples of this online so any help/suggestion would be greatly appreciated.</p>
  
  <pre><code> Public Sub ApplyDataGraphicToDocument()
      Dim mstDG As Visio.Master
      Dim shp As Visio.Shape
      Dim pag As Visio.Page
      Dim firstProp As String
  
         If Visio.ActiveWindow.Selection.Count = 0 Then
             MsgBox "Please select a shape which already has data graphics"
             Exit Sub
         Else
             Set shp = Visio.ActiveWindow.Selection.PrimaryItem
            If shp.DataGraphic Is Nothing Then
                 MsgBox "Please select a shape which already has data graphics"
                Exit Sub
             Else
                'Get the shapes DataGraphic master
                Set mstDG = shp.DataGraphic
                 'Get the name of the first Shape Data row
                firstProp = "Prop." &amp; _
   shp.CellsSRC(Visio.visSectionProp, 0, 0).RowNameU
             End If
        End If
  
         For Each pag In Visio.ActiveDocument.Pages
             If pag.Type = visTypeForeground Then
                 For Each shp In pag.Shapes
             'Check that the named Shape Data row exists
                    If shp.CellExistsU(firstProp, Visio.visExistsAnywhere) Then
                        'Set the DataGraphic
                        shp.DataGraphic = mstDG
                                         End If
                Next
            End If
        Next
  
    End Sub
  
  </code></pre>