• Transferring PowerPoint notes pages to Word (VBA PowerPoint/Word 2000)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Transferring PowerPoint notes pages to Word (VBA PowerPoint/Word 2000)

    Author
    Topic
    #367936

    Is there a way use a macro to transfer information from the Notes pages in a PowerPoint file to a Word file?

    Sure I know you can cut and paste, but that’s tedious. I’ve never tried VBA between applications before, but I can’t help but think it can be done.

    Thanks!!
    Troy

    Viewing 0 reply threads
    Author
    Replies
    • #575178

      As you probably know, you can use the File | Send To | Microsoft Word menu to do this, but you also get a copy of the slides. However, since the slides are all in column 2, you can just delete this column, but now it is unclear what slide you are on. Here is a macro that sends the first placeholder and the notes to word. If you record a dummy macro and then edit that macro, you can replace the dummy with the code below. Copy the code below, then paste it into a blank word document, select the text in Word, and use that text to replace your dummy macro (gets rid of htlm formatting). Finally, while editing the macro, you must use the Tools | References to set a reference to the Microsoft Word Object Library. HTH –Sam

      Option Explicit
      
      Sub sendNotesToWord()
      Dim wrdApp As New Word.Application
      Dim wrdDoc As Word.Document
      Dim intSaveView As Integer
      Dim intSaveNumber As Integer
      Dim i As Integer
          intSaveView = ActiveWindow.ViewType
          intSaveNumber = ActiveWindow.Selection.SlideRange.SlideNumber
          wrdApp.Visible = True
          Set wrdDoc = wrdApp.Documents.Add
          For i = 1 To ActiveWindow.Presentation.Slides.Count
              ActiveWindow.View.GotoSlide i
              ActiveWindow.ViewType = ppViewSlide
              wrdDoc.Range.InsertAfter "Slide " & i & ": "
              With ActiveWindow.Selection.SlideRange.Shapes(1)
                  If .HasTextFrame Then
                      wrdDoc.Range.InsertAfter .TextFrame.TextRange.Text & vbCr & vbCr
                  Else
                      wrdDoc.Range.InsertAfter vbCr & vbCr
                  End If
              End With
              ActiveWindow.ViewType = ppViewNotesPage
              wrdDoc.Range.InsertAfter _
                  ActiveWindow.Selection.SlideRange.Shapes(2).TextFrame.TextRange.Text
              wrdDoc.Range.InsertAfter vbCr & vbCr & "-----" & vbCr & vbCr
          Next i
          ActiveWindow.ViewType = intSaveView
          ActiveWindow.View.GotoSlide intSaveNumber
      End Sub
    Viewing 0 reply threads
    Reply To: Transferring PowerPoint notes pages to Word (VBA PowerPoint/Word 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: