Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Aug 2011
    Posts
    112
    Thanks
    35
    Thanked 3 Times in 3 Posts

    VBA code to change all boxes in SmartArt hierarchy chart graphic

    I see in ppt there is not an option to record a macro like in Excel.

    Is there a way in ppt to select all boxes in a hierarchy chart a change the shape outline to a weight of 1 pt?

    Is there also a website anybody knows of which can help me to understand other attributes of the boxes I could change?

  2. #2
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts
    You need to say which version you have. vba support for Smart Art is nearly non existant in version 2007 but better in 2010 on.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2011
    Posts
    112
    Thanks
    35
    Thanked 3 Times in 3 Posts
    Hi John,

    2010

  4. #4
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by jrb View Post
    Hi John,

    2010
    I would say the easiet way is to treat the parent shape as a group.

    This should get you started (change the shape type if needed)

    Code:
    Sub S_Art()
    Dim oSA As SmartArt
    Dim oparent As Shape
    Dim i As Integer
    Dim s As Integer
    On Error Resume Next
    Err.Clear
    Set oSA = ActiveWindow.Selection.ShapeRange(1).SmartArt
    If Err <> 0 Then
    MsgBox "Error"
    Exit Sub 'nothing selected or it's not smart art
    End If
    Set oparent = oSA.Parent
    For i = 1 To oparent.GroupItems.Count
    'only target the shape type you want
    If oparent.GroupItems(i).AutoShapeType = msoShapeRectangle Then
    With oparent.GroupItems(i).Line
    .Visible = True
    .ForeColor.RGB = RGB(255, 0, 0)
    .Weight = 1
    End With
    End If
    Next i
    End Sub

  5. The Following User Says Thank You to JohnWilson For This Useful Post:

    jrb (2015-02-09)

  6. #5
    2 Star Lounger
    Join Date
    Aug 2011
    Posts
    112
    Thanks
    35
    Thanked 3 Times in 3 Posts
    Thanks John. I'll give this a try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •