如何从PowerPoint演示文件中读取和存储演讲者笔记

本文关键字:读取 存储 演讲者 笔记 文件 PowerPoint | 更新日期: 2023-09-27 17:50:58

如何从存储在我的硬盘位置的PowerPoint演示文件中读取和存储演讲者笔记?

using Microsoft.Office.Interop.PowerPoint;
Application PowerPoint_App = new Application();
Presentations multi_presentations = PowerPoint_App.Presentations;
Presentation presentation = multi_presentations.Open(@"D:'Peak Sourcing'Work'ppt_test'presenting.ppt");

如何从PowerPoint演示文件中读取和存储演讲者笔记

演示文稿的Slides集合中的每张幻灯片都有一个NotePage成员。NotesPage基本上是一个单独的幻灯片,具有所有相同的集合和方法。下面是一个VBA函数,它将从幻灯片中返回注释文本:

Function NotesText(oSl As Slide) As String
    Dim oSh As Shape
    
    For Each oSh In oSl.NotesPage.Shapes
        If oSh.Type = msoPlaceholder Then
            If oSh.PlaceholderFormat.Type = ppPlaceholderBody Then
                If oSh.TextFrame.HasText Then
                    NotesText = oSh.TextFrame.TextRange.Text
                End If
            End If
        End If
    Next
End Function