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

相关推荐
PythonFun2 天前
Python批量下载PPT模块并实现自动解压
开发语言·python·powerpoint
潘多编程3 天前
使用Spring Boot与AnalyticDB结合通义千问API实现智能PPT生成功能
spring boot·后端·powerpoint
徐同保6 天前
vue3+PPTXjs 在线ppt预览
前端·javascript·powerpoint
大侠之运维8 天前
推荐一款开源的链路监控系统
powerpoint
fxybg20229 天前
AI助力PPT制作:开启高效创作新时代
人工智能·学习·pdf·word·powerpoint
向阳2569 天前
一键生成PPT的AI工具-Kimi!
人工智能·ai·powerpoint·ppt
AI王也10 天前
【AIGC】ChatGPT RAG提取文档内容,高效制作PPT、论文
人工智能·chatgpt·prompt·aigc·powerpoint
2401_8566522110 天前
2024从传统到智能,AI做PPT软件的崛起之路
人工智能·ai·word·powerpoint·ppt
红岸JD瞭望者11 天前
生成PPT时支持上传本地的PPT模板了!
powerpoint
fxybg202214 天前
2024AI做PPT软件如何重塑演示文稿的创作
人工智能·ai·自然语言处理·powerpoint·机器翻译