PPT 批量删除每页相同位置的内容

方法:

选择【视图】,【宏】,设置宏的名称,点创建
将下列函数复制到宏中,在ppt中先选择某个要删除的对象,然后运行宏即可

函数内容如下

Sub Delete( )

Dim oSlide As Slide, oShape As Shape

Dim myWidth As Single, myHeight As Single, myTop As Single, myLeft As Single

On Error Resume Next

If ActiveWindow.Selection.ShapeRange.Count <> 1 Then

If Err.Number <> 0 Then

MsgBox "none" & vbCrLf & "choose one", vbExclamation + vbOKOnly

Err.Clear

Exit Sub

End If

MsgBox "choose exceed 1" & vbCrLf & "choose one", vbExclamation + vbOKOnly

Exit Sub

End If

Set oShape = ActiveWindow.Selection.ShapeRange(1)

myTop = oShape.Top

myLeft = oShape.Left

myHeight = oShape.Height

myWidth = oShape.Width

For Each oSlide In ActivePresentation.Slides

For Each oShape In oSlide.Shapes

If Abs(myTop - oShape.Top) < 1 And Abs(myLeft - oShape.Left) < 1 And Abs(myHeight - oShape.Height) < 1 And Abs(myWidth - oShape.Width) < 1 Then

oShape.Delete

End If

Next

Next

End Sub

相关推荐
SunnyDays101110 小时前
Java 操作 PPT 超链接:添加、修改和删除
java·powerpoint·ppt·超链接
溜达的大象15 小时前
飞牛NAS部署ONLYOFFICE Docs:把文档、表格和PPT的在线编辑能力放到自己的服务器上
运维·服务器·powerpoint
ms365copilot18 小时前
我不再自己做 Word、Excel 和 PPT 了,我让 Copilot 直接帮我创建 (1)
word·powerpoint·excel·copilot
小幂同学3 天前
AIPPT 使用说明:从主题输入或文档大纲生成 PPT!
powerpoint
RichardLau_Cx4 天前
PPT工具选型指南:WPS、PowerPoint、Canva 与 AI 办公助手(豆包_千问_WorkBuddy)到底怎么选?
人工智能·powerpoint·wps
白帽攻防录5 天前
SRC 挖洞:PowerPoint 四个 RCE,预览窗格怎么变成零点击入口
网络安全·powerpoint·文档安全
学术 学术 Fun6 天前
截图转可编辑 PPT:旧流程图改步骤,不再靠白色方块遮字
powerpoint·流程图
qq_364682156 天前
Android APP会议记录工具生成图文内容
人工智能·powerpoint
SunnyDays10117 天前
如何使用 Java 提取 PPT 中的文字:整份文档、指定幻灯片与表格内容
java·powerpoint
传人once7 天前
从 PPT 到可交互原型:用 AI 做小程序原型的实践 | 深度实践版
人工智能·powerpoint·交互