Consulting

Results 1 to 15 of 15

Thread: Referring subtitle of a slide in order to format using VBA PowerPoint

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Referring subtitle of a slide in order to format using VBA PowerPoint

    Hello all,

    I am trying to set the position and formatting of title, subtitle in the slide. I tried doing it using the following code. It works on title but not on subtitle. How can we get reference of subtitle to work on its position, font size etc.

    Sub Titles()
    Dim osld As Slide, oshp As Shape
    For Each osld In ActivePresentation.Slides
    For Each oshp In osld.Shapes
    If oshp.Type = msoPlaceholder Then
    
    If oshp.PlaceholderFormat.Type = ppPlaceholderTitle Then
    With oshp
    .Top = 5
    .Left = 5
    .TextFrame.TextRange.Font.Name = "Times New Roman"
    .TextFrame.TextRange.Font.Size = 24
    End With
    
    ElseIf oshp.PlaceholderFormat.Type = ppPlaceholderSubtitle Then
    With oshp
    .Top = 10
    .Left = 10
    .TextFrame.TextRange.Font.Name = "Times New Roman"
    .TextFrame.TextRange.Font.Size = 18
    End With
    
    End If
    
    
    End If
    
    Next oshp
    Next osld
    End Sub
    Attached Images Attached Images
    Last edited by Paul_Hossler; 09-06-2019 at 09:21 AM. Reason: Added CODE tags

Posting Permissions

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