Wie kann ich ein PowerPoint in einfachen Text konvertieren?

8890
Pikamander2

Ich habe eine PowerPoint-Datei (.pptx) mit 100 Folien. Ich möchte den gesamten Text daraus entnehmen und als reine Textdatei speichern.

Wie kann ich das machen? In PowerPoint scheint es nicht möglich zu sein, dass Sie es direkt als .txt-Datei speichern, und ich möchte nicht jede Folie durchgehen, um den Text zu kopieren.

5
Kurz gesagt: .pptx in .zip umbenennen, in zip schauen - es gibt XML-Dateien. Suchen Sie die XML-Datei mit dem gleichen Text wie auf Ihren Folien und parsen Sie die XML-Datei mit Ihrem bevorzugten XML-Parser. mnmnc vor 7 Jahren 1
@mnmnc - Wenn es Ihnen nichts ausmacht, geben Sie dies bitte als Antwort mit groben Anweisungen dazu an Pikamander2 vor 7 Jahren 2

3 Antworten auf die Frage

2
Jaleks

Exportieren Sie als PDF, Kopieren und Einfügen (STRG + A, STRG + C) aus Ihrem PDF-Reader.

Wenn Sie etwas formatieren möchten, exportieren Sie das PDF über pdftotext mit dem Parameter-layout

Dies wird Ihnen einige wirklich grobe Formatierungen bringen, aber angesichts der Frage können Sie nicht viel dagegen tun. Eine Aufklärung des OP wäre eine gute Idee. Seth vor 7 Jahren 0
Für die meisten Folien sollte dies etwas OK sein, spätestens nach dem Export mit `-layout` Jaleks vor 7 Jahren 0
1
Steve Rindsberg

Wenn der gesamte Text in der Präsentation in der Gliederungsansicht sichtbar ist, sollten Sie Datei | Speichern unter | Wählen Sie Gliederung (RTF) .

Andernfalls benötigen Sie etwas VBA. Auf meiner PowerPoint-FAQ-Website finden Sie einige Beispiele:

Text in eine Textdatei exportieren, Text aus PowerPoint (Mac oder PC) extrahieren:

Siehe: http://www.pptfaq.com/FAQ00274_Export_Text_to_a_text_file-_extract_text_from_PowerPoint_-Mac_or_PC-.htm


Es speichert den Text von jeder Form auf Ihren Notizseiten in einer Datei namens NotesText.TXT im selben Ordner wie die PowerPoint-Präsentation.

Sub SaveNotesText()  Dim oPres As Presentation Dim oSlides As Slides Dim oSlide As Slide Dim oShapes As Shapes Dim oSh As Shape Dim NotesText As String Dim FileNum As Integer Dim PathSep As String  #If Mac Then PathSep = ":" #Else PathSep = "\" #End If  Set oPres = ActivePresentation Set oSlides = oPres.Slides  For Each oSlide In oSlides NotesText = NotesText & "Slide " & oSlide.SlideIndex & vbCrLf Set oShapes = oSlide.NotesPage.Shapes For Each oSh In oShapes If oSh.HasTextFrame Then If oSh.TextFrame.HasText Then NotesText = NotesText & oSh.TextFrame.TextRange.Text End If End If Next oSh NotesText = NotesText & vbCrLf Next oSlide  FileNum = FreeFile Open oPres.Path & PathSep & "NotesText.TXT" For Output As FileNum Print #FileNum, NotesText Close FileNum  End Sub 

Hier ist ein Makro von Kris Lander, das den gesamten Text auf jeder Folie einer Präsentation exportiert. Es wurde ein wenig geändert, damit es auf Macs funktioniert und zwischen Titel, Untertitel, Text und anderem Text unterschieden wird.

Sub ExportText()  Dim oPres As Presentation Dim oSlides As Slides Dim oSld As Slide 'Slide Object Dim oShp As Shape 'Shape Object Dim iFile As Integer 'File handle for output iFile = FreeFile 'Get a free file number Dim PathSep As String Dim FileNum As Integer  #If Mac Then PathSep = ":" #Else PathSep = "\" #End If  Set oPres = ActivePresentation Set oSlides = oPres.Slides  FileNum = FreeFile  'Open output file ' NOTE: errors here if file hasn't been saved Open oPres.Path & PathSep & "AllText.TXT" For Output As FileNum  For Each oSld In oSlides 'Loop thru each slide For Each oShp In oSld.Shapes 'Loop thru each shape on slide  'Check to see if shape has a text frame and text If oShp.HasTextFrame And oShp.TextFrame.HasText Then If oShp.Type = msoPlaceholder Then Select Case oShp.PlaceholderFormat.Type Case Is = ppPlaceholderTitle, ppPlaceholderCenterTitle Print #iFile, "Title:" & vbTab & oShp.TextFrame.TextRange Case Is = ppPlaceholderBody Print #iFile, "Body:" & vbTab & oShp.TextFrame.TextRange Case Is = ppPlaceholderSubtitle Print #iFile, "SubTitle:" & vbTab & oShp.TextFrame.TextRange Case Else Print #iFile, "Other Placeholder:" & vbTab & oShp.TextFrame.TextRange End Select Else Print #iFile, vbTab & oShp.TextFrame.TextRange End If ' msoPlaceholder End If ' Has text frame/Has text  Next oShp Next oSld  'Close output file Close #iFile  End Sub 

Und hier werden wir etwas kniffliger und folgen dem Text in Gruppen. Und in Gruppen innerhalb von Gruppen. Sehen Sie sich das zu genau an, und Ihr Kopf kann weh tun.

Sub ExportText()  Dim oPres As Presentation Dim oSlides As Slides Dim oSld As Slide 'Slide Object Dim oShp As Shape 'Shape Object Dim iFile As Integer 'File handle for output iFile = FreeFile 'Get a free file number Dim PathSep As String Dim FileNum As Integer Dim sTempString As String  #If Mac Then PathSep = ":" #Else PathSep = "\" #End If  Set oPres = ActivePresentation Set oSlides = oPres.Slides  FileNum = FreeFile  'Open output file ' NOTE: errors here if file hasn't been saved Open oPres.Path & PathSep & "AllText.TXT" For Output As FileNum  For Each oSld In oSlides 'Loop thru each slide ' Include the slide number (the number that will appear in slide's ' page number placeholder; you could also use SlideIndex ' for the ordinal number of the slide in the file Print #iFile, "Slide:" & vbTab & cstr(oSld.SlideNumber)  For Each oShp In oSld.Shapes 'Loop thru each shape on slide 'Check to see if shape has a text frame and text If oShp.HasTextFrame And oShp.TextFrame.HasText Then If oShp.Type = msoPlaceholder Then Select Case oShp.PlaceholderFormat.Type Case Is = ppPlaceholderTitle, ppPlaceholderCenterTitle Print #iFile, "Title:" & vbTab & oShp.TextFrame.TextRange Case Is = ppPlaceholderBody Print #iFile, "Body:" & vbTab & oShp.TextFrame.TextRange Case Is = ppPlaceholderSubtitle Print #iFile, "SubTitle:" & vbTab & oShp.TextFrame.TextRange Case Else Print #iFile, "Other Placeholder:" & vbTab & oShp.TextFrame.TextRange End Select Else Print #iFile, vbTab & oShp.TextFrame.TextRange End If ' msoPlaceholder Else ' it doesn't have a textframe - it might be a group that contains text so: If oShp.Type = msoGroup Then sTempString = TextFromGroupShape(oShp) If Len(sTempString) > 0 Then Print #iFile, sTempString End If End If End If ' Has text frame/Has text  Next oShp Next oSld  'Close output file Close #iFile  End Sub  Function TextFromGroupShape(oSh As Shape) As String ' Returns the text from the shapes in a group ' and recursively, text within shapes within groups within groups etc.  Dim oGpSh As Shape Dim sTempText As String  If oSh.Type = msoGroup Then For Each oGpSh In oSh.GroupItems With oGpSh If .Type = msoGroup Then sTempText = sTempText & TextFromGroupShape(oGpSh) Else If .HasTextFrame Then If .TextFrame.HasText Then sTempText = sTempText & "(Gp:) " & .TextFrame.TextRange.Text & vbCrLf End If End If End If End With Next End If  TextFromGroupShape = sTempText  NormalExit: Exit Function  Errorhandler: Resume Next  End Function 
1
RedRiderX

Diese Lösung hängt von der Kompatibilität Ihres Slidedecks mit Google Slides ab. Sie können jedoch die Option "Nur Text herunterladen" in Google Slides verwenden:

Zugegeben, Sie verlieren alle ausgefallenen Formatierungs- oder Layout-Elemente, die Sie erstellt haben, erhalten jedoch den Text des Dokuments.

Das hat sehr gut funktioniert und glatt. Wenn ich die .txt-Datei nach .docx kopiert habe, wurden auch die Zeilen- und Absatzumbrüche angezeigt. Sehr hilfreich. wayfarer vor 5 Jahren 0