如何才能找到两个 powerpoint 文件之间唯一的内容(即文本)差异?
我用的是PPT 2013。它有一个比较工具,但它也能找到所有的文本框移动、动画变化、格式差异等,这使得很难看出是否有任何文本变化。
我需要比较“纯文本”并显示文本的任何变化
语境
我的客户给了我一个PPT文件。我将对其进行格式化(颜色、字体、动画等),但我不应该更改任何文本内容。如果我错误地删除或插入了任何内容,我希望能够检测到它,以便我可以还原它。
如何才能找到两个 powerpoint 文件之间唯一的内容(即文本)差异?
我用的是PPT 2013。它有一个比较工具,但它也能找到所有的文本框移动、动画变化、格式差异等,这使得很难看出是否有任何文本变化。
我需要比较“纯文本”并显示文本的任何变化
我的客户给了我一个PPT文件。我将对其进行格式化(颜色、字体、动画等),但我不应该更改任何文本内容。如果我错误地删除或插入了任何内容,我希望能够检测到它,以便我可以还原它。
在 PowerPoint 2013 中,您可以将 PowerPoint 文件内容导出为 word 或 pdf 文件,然后您可以使用它来仅比较文本更改:
选择“文件”>“导出”、“创建讲义”,然后单击“创建讲义”按钮。
在打开的对话框中,选择仅大纲选项,然后单击确定。Word 将打开您的文本。
更新:
您可以运行此 VBS 脚本将文本提取到文本文件中,然后您可以比较这两个文件。
它来自工具Beyond Compare 4,可以作为试用版下载。如果您只想比较工具中的文本更改,也可以下载 PowerPoint 文件的其他文件格式。
' PPT_to_TXT.vbs
'
' Extracts plain text from a PowerPoint document. Requires Microsoft PowerPoint.
' Usage:
' WScript PPT_to_TXT.vbs <input file> <output file>
Option Explicit
' MsoAutomationSecurity
Const msoAutomationSecurityForceDisable = 3
' OpenTextFile iomode
Const ForAppending = 8
Dim App, AutoSec, Doc, FileSys
Set FileSys = CreateObject("Scripting.FileSystemObject")
If FileSys.FileExists(WScript.Arguments(1)) Then
FileSys.DeleteFile WScript.Arguments(1)
End If
Set App = CreateObject("Powerpoint.Application")
On Error Resume Next
App.DisplayAlerts = False
AutoSec = App.AutomationSecurity
App.AutomationSecurity = msoAutomationSecurityForceDisable
Err.Clear
Dim Comment, Shape, Slide, TgtFile
Set Doc = App.Presentations.Open(WScript.Arguments(0), True, , False)
If Err = 0 Then
Set TgtFile = FileSys.OpenTextFile(WScript.Arguments(1), ForAppending, True)
For Each Slide In Doc.Slides
For Each Shape In Slide.Shapes
If Shape.HasTextFrame Then
If Shape.TextFrame.HasText Then
TgtFile.WriteLine Shape.TextFrame.TextRange.Text
End If
End If
Next
For Each Shape In Slide.NotesPage.Shapes
If Shape.HasTextFrame Then
If Shape.TextFrame.HasText Then
TgtFile.WriteLine Shape.TextFrame.TextRange.Text
End If
End If
Next
For Each Comment In Slide.Comments
TgtFile.WriteLine Comment.Author & vbTAB & Comment.DateTime & vbTAB & Comment.Text
Next
Next
TgtFile.Close
Doc.Close
End If
App.AutomationSecurity = AutoSec
App.Quit