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

相关推荐
带土113 天前
11. MathType卸载后PowerPoint启动时无显示法加载MathType公式编辑器加载项
powerpoint
m5655bj13 天前
通过 C# 将 PPT 文档转换为 HTML 格式
c#·html·powerpoint
道纪书生14 天前
解决报错:很抱歉,powerpoint/word/excel遇到错误,使其无法正常工作......
word·powerpoint·excel
johnny23315 天前
PPT生成工具
powerpoint
小真zzz18 天前
ChatPPT Nano Banana Pro · Magic模式深度解析 ——重新定义“所想即所得”的PPT智能编辑
人工智能·ai·powerpoint·ppt·aippt
王解20 天前
AI生成PPT的技术演进:从智能填充到认知增强
人工智能·powerpoint
2501_9469614721 天前
PPT课件怎么做?2026最新版制作流程与免费资源汇总
powerpoint
github.com/starRTC21 天前
Claude Code中英文系列教程35:通过API使用Skills创建ppt,word文档和pdf
pdf·word·powerpoint·ai编程
琛説23 天前
⚡PitchPPT:将PPT导出为高清全图PPT,并控制PPT文件大小在固定MB/GB以内【解析算法原理 · 作者谈】
windows·python·算法·github·powerpoint