Microsoft KB Archive/307792

From BetaArchive Wiki
Knowledge Base


Use Visual Basic for Applications to extract slide notes in PowerPoint 2002

Article ID: 307792

Article Last Modified on 8/13/2007



APPLIES TO

  • Microsoft PowerPoint 2002 Standard Edition
  • Microsoft Visual Basic for Applications 6.0



This article was previously published under Q307792

SUMMARY

You may want to extract all note information that is associated with your slides in Microsoft PowerPoint 2002. This article contains sample Microsoft Visual Basic for Applications (VBA) code that is contained in a macro. This code demonstrates how to retrieve and how to print out comments in the Debug window from each slide in a PowerPoint presentation.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, visit the following Microsoft Web site:

For additional information about the support options available from Microsoft, visit the following Microsoft Web site:


Note The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

230746 PPT: Viewer: Presentation Macros Don't Run Within the Viewer



Sub GetAllComments()

        
        'Loop through all slides in presentation
        For a = 1 To ActivePresentation.Slides.Count
        
        Debug.Print "**********Slide #" & a & "**********"
                
           'Loop through all comments on a slide
           For i = 1 To ActivePresentation.Slides(a).Comments.Count
                With ActivePresentation.Slides(a).Comments(i)
                Debug.Print .Author & " " & .DateTime
               
                Debug.Print vbTab & .Text
              
                End With
           Next
        Next
         
      MsgBox "To see the results, open the " _
            & "Immediate Window in the Visual Basic Editor." _
            , vbInformation, "Macro Completed"
         
End Sub

                

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

212536 How to run sample code from Knowledge Base articles


Keywords: kbhowto KB307792