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

相关推荐
ms365copilot11 小时前
Copilot生成水果店经营PPT
microsoft·产品运营·powerpoint·copilot
JAVA老架构AI智能化14 小时前
PPT Master Lite — 浏览器端 AI 驱动的 PPT 生成器
人工智能·powerpoint
copilot中国版15 小时前
PowerPoint Copilot内置技能|“优化幻灯片标题”有什么用?
powerpoint·copilot
qq_364682151 天前
汇报材料怎么快速生成PPT?科会通工具实操
powerpoint
言乐62 天前
HTML实现Word、Excel、PPT三种可切换背景,可键盘打字、和像素小人交互
html·word·powerpoint·excel·交互
copilot中国版3 天前
PPT Copilot 一键统一全篇版式,告别字体混乱、元素错位和重复排版
html·powerpoint·copilot
鲲穹AI种草7 天前
AI 生成 PPT 工具怎么选?鲲穹 PPT 功能实测与横向对比
人工智能·powerpoint
qq_3691736311 天前
一句话将 Word、PPT、PDF 发布成链接
人工智能·pdf·word·powerpoint·效率工具·ai 办公
weixin_4045512414 天前
使用 ZCode 改造 PPT 模板:实践复盘与能力边界
人工智能·powerpoint
小淮AI15 天前
AI生成PPT工具的功能观察:百度文库、Gamma、WPS AI
人工智能·powerpoint·wps