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

相关推荐
dagouaofei15 小时前
AI生成个性化年终总结PPT
人工智能·python·powerpoint
dagouaofei1 天前
AI制作年终总结PPT零基础可用
人工智能·python·powerpoint
E_ICEBLUE1 天前
使用 Java 将 PowerPoint 转换为 PDF 的完整指南
java·开发语言·pdf·powerpoint·ppt
dagouaofei2 天前
AI自动生成你的年度报告PPT
人工智能·python·powerpoint
风萧萧19993 天前
Java:PPT转图片
java·python·powerpoint
dagouaofei3 天前
年终总结PPT用AI最快生成
人工智能·python·powerpoint
EAIReport3 天前
AI自动生成PPT报告产品技术实现与应用案例
人工智能·powerpoint
WordinPPT_20254 天前
职称申报答辩ppt制作案例模板下载|WordinPPT
powerpoint·ppt
阿雄不会写代码4 天前
PPT 主题颜色解释(Theme Color Scheme)
powerpoint