![](/img/trans.png)
[英]Powerpoint slides: how to copy my combobox and textbox controls on one slide to a another slide, same presentation?
[英]Is it possible to check if a slide in one PowerPoint presentation is the same as a slide in another deck?
我需要能夠確定兩個演示文稿中的(某些)幻燈片是否相同。 基本上每月更新一次主演示文稿,並存檔以前的版本。 幻燈片順序保持不變,只是這些幻燈片的內容可能已更改。 麻煩是......
deck1.Slides(i)=deck2.Slides(i)
......不起作用,......
deck1.Slides(i).SlideID=deck2.Slides(i).SlideID
...即使幻燈片內容已更改,也會返回相同的值。
我想知道校驗和幻燈片是否可能,但是我沒有在網上找到任何可以實現這一點的東西 - 我遇到的VBA校驗和例程包括僅用於文本字符串。 校驗和幻燈片或對象是否可能,或者我錯過了一些明顯的東西?
雖然這絕不是一個可隨時部署的解決方案,但這可能提供一個起點,前提是您的具體任務是在看似相同的演示文稿中檢查已更改的文本內容。
我將其縮小到比較幻燈片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
一般注意事項:
Shape(Index) = Shapes.Count+1
,但你永遠不知道人們對你的演示做了什么...... 希望有人想出一個更優雅的方法來解決這個問題!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.