Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2014
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PowerPoint macro: Copy text from slide text to slide notes area

    I want to copy the text from PowerPoint slides to the notes section of the PowerPoint.

    If there are 2 shapes with text - I want to copy both, appending the text in the notes section.

    I tried the code below ---but am getting an error message on "curNotes = curSlide.NotesPage.Shapes(1)."

    Please help!

    Code:
    Dim curPres As PowerPoint.Presentation
    Dim curSlide As Slide
    Dim curShape As Shape
    Dim curNotes As Shape
    
    
    
    
    For Each curSlide In ActivePresentation.Slides
    
        For Each curShape In curSlide.Shapes
            If curShape.TextFrame.HasText Then
                 curShape.TextFrame.TextRange.Copy
                 curNotes = curSlide.NotesPage.Shapes(1)
                 curNotes.TextFrame.TextRange.Paste
            End If
    
        Next curShape
    
    Next curSlide
    
    
    End Sub

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    There is probably a more efficient way to do this but this appears to work
    Code:
    Sub GoGetEm()
      Dim curSlide As Slide
      Dim curShape As Shape
      Dim curNotes As Shape
      Dim oSh As Shape
      
      For Each curSlide In ActivePresentation.Slides
        For Each oSh In curSlide.NotesPage.Shapes
          If oSh.PlaceholderFormat.Type = ppPlaceholderBody Then
            Set curNotes = oSh
            Exit For
          End If
        Next oSh
        For Each curShape In curSlide.Shapes
          If curShape.TextFrame.HasText Then
            curNotes.TextFrame.TextRange.InsertAfter curShape.TextFrame.TextRange.Text & vbCr
          End If
        Next curShape
      Next curSlide
    End Sub
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    New Lounger
    Join Date
    Feb 2014
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    This works GREAT! Many thanks!

    Except there are two small problems --- it also copies the slide title and the page number. Is there any way to identify these elements so I can skip coping them?

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    It is possible that we can work out what type of object the text comes from but without seeing the actual presentation file I can't be sure it would work.

    The fact that you can isolate the placeholderformat.type on the notes page would imply that you could do the same on the slide itself but I have seen lots of powerpoint files with random text boxes used on the page instead of slide master placeholders. Try to add an if statement inside the curShape loop to verify the placeholderformat is not title or pagenumber types.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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