简体   繁体   English

是否可以检查一个PowerPoint演示文稿中的幻灯片是否与另一个套牌中的幻灯片相同?

[英]Is it possible to check if a slide in one PowerPoint presentation is the same as a slide in another deck?

I need to be able to determine whether (some) slides in two presentations are identical. 我需要能够确定两个演示文稿中的(某些)幻灯片是否相同。 Essentially a master presentation is updated every month and the previous version archived. 基本上每月更新一次主演示文稿,并存档以前的版本。 The slide order remains the same, just the content of those slides may have changed. 幻灯片顺序保持不变,只是这些幻灯片的内容可能已更改。 The trouble is... 麻烦是......

deck1.Slides(i)=deck2.Slides(i)

...doesn't work, and ... ......不起作用,......

deck1.Slides(i).SlideID=deck2.Slides(i).SlideID

...returns identical values even if the slide content has changed. ...即使幻灯片内容已更改,也会返回相同的值。

I was wondering whether it is possible to checksum slides, but I haven't found anything online that would accomplish this -- the VBA checksum routines I've come across including on here are for text strings only. 我想知道校验和幻灯片是否可能,但是我没有在网上找到任何可以实现这一点的东西 - 我遇到的VBA校验和例程包括仅用于文本字符串。 Is it possible to checksum slides or objects, or am I missing something obvious? 校验和幻灯片或对象是否可能,或者我错过了一些明显的东西?

While this is by no means a ready-to-deploy solution, this might provide a starting point, provided your specific task is to check for changed text-contents in seemingly identical presentations. 虽然这绝不是一个可随时部署的解决方案,但这可能提供一个起点,前提是您的具体任务是在看似相同的演示文稿中检查已更改的文本内容。

I narrowed this down to comparing the text-contents of Textboxes (shape-type 14) on Slide 1 for this demonstration. 我将其缩小到比较幻灯片1上文本框(形状类型14)的文本内容以进行此演示。

Sub Neu()
    Dim ppt As New PowerPoint.Application

    Dim i As Integer, j As Integer        
    i = 1
    For j = 1 To ppt.Presentations(1).Slides(i).Shapes.Count

        If ppt.Presentations(1).Slides(i).Shapes(j).Type = 14 And _
            Presentations(2).Slides(i).Shapes(j).Type = 14 Then _            
                Debug.Print _
                    ppt.Presentations(1).Slides(i).Shapes(j).TextFrame.TextRange.Text = _
                    Presentations(2).Slides(i).Shapes(j).TextFrame.TextRange.Text

    Next j
End Sub

General Notes: 一般注意事项:

  • This obviously doesn't account for changed formats or placings. 这显然不能解释格式或位置的变化。
  • I would expect some trouble as soon as there are new Shapes added to one of the Slides. 一旦有新的Shapes添加到其中一个幻灯片中,我会发现一些麻烦。
  • Afaik, when adding a new shape it should have Shape(Index) = Shapes.Count+1 , but you never know what people do to your presentation... Afaik,当添加一个新的形状时,它应该有Shape(Index) = Shapes.Count+1 ,但你永远不知道人们对你的演示做了什么......

Hopefully, someone comes up with a more elegant approach to solving this! 希望有人想出一个更优雅的方法来解决这个问题!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Powerpoint幻灯片:如何将我在一张幻灯片上的组合框和文本框控件复制到另一张相同演示文稿的幻灯片上? - Powerpoint slides: how to copy my combobox and textbox controls on one slide to a another slide, same presentation? 在 PowerPoint 演示文稿中复制幻灯片 - Duplicating a slide in PowerPoint presentation 在另一个 Powerpoint 演示文稿中嵌入来自其他 Powerpoint 演示文稿的幻灯片的链接副本 - Embed a linked copy of a slide from other Powerpoint presentation in another Powerpoint presentation VBA for Powerpoint:通过选择另一个 Powerpoint 中的按钮来更改一个 Powerpoint 中的幻灯片 - VBA for Powerpoint: Change Slide in One Powerpoint by Selecting Button in Another 有没有直接的方法来获取PowerPoint演示文稿中幻灯片的索引? - Is there a direct way to get the index of a slide in a PowerPoint presentation? 将一张幻灯片复制到多个演示文稿 - Copy one slide to multiple presentation 将更多的 PowerPoint 演示文稿合并到一个新的演示文稿中,并保留 Lotusscript 中的原始幻灯片布局 - Join more powerpoint presentations into one new presentation keeping the originally slide-layout in Lotusscript 从Access VBA打开PowerPoint演示文稿的特定幻灯片 - open particular slide of powerpoint presentation from access vba Select 基于幻灯片标签的 Powerpoint 幻灯片并复制到新的演示文稿中 - Select Powerpoint slides based on the slide tags and copy into a new presentation 在VBA powerpoint中如何将新幻灯片添加到空的演示文稿中 - in VBA powerpoint How to add a new slide to an empty presentation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM