在关闭带有IF条件的PowerPoint之前提示用户 [英] Prompt a user before closing PowerPoint with IF condition

查看:62
本文介绍了在关闭带有IF条件的PowerPoint之前提示用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果对象仍在演示文稿中,我希望PowerPoint在PowerPoint关闭之前提示用户.(我会标记的对象).

I would like PowerPoint to prompt the user before PowerPoint closes if an object is still in the presentation. (An object I would have tagged).

因此PowerPoint将检查该对象是否存在,并且它们会提示用户该对象是否存在,或者提示用户不存在.

So PowerPoint would check if that object exist and them prompt the user if it exist or close if it doesn't exist.

希望这有意义吗?问候,菲利普(Philippe)

Hopefully this makes sense? Regards, Philippe

我认为我需要使用If语句,但是不确定应该在哪里/如何处理它.但是我完全迷失了自己!!

I think I need to use an If statement but unsure where/how I should go about it. But I am completely lost and confused!?

Private Sub Application.Presentations()
Dim oSh As Shape

For Each oSh In ActiveWindow.Selection.ShapeRange
oSh.Tags.Add "Stamp"
Next

If MsgBox("A stamp is still on the presentation. Are you sure that you want to close this book?", vbYesNo) = vbYes Then 
    Exit Sub 
Else 
    Cancel = True 
End If 

End Sub

推荐答案

您将需要学习如何使用PowerPoint事件以及如何创建外接程序.AutoClose VBA命令或PresentationClose事件都将提供用于挂起您的检查代码的钩子.大事记:使您的VBA代码在PowerPoint中响应事件加载项:使用运行宏的TOOLBARS创建ADD-IN

You'll need to learn how to use PowerPoint events and how to create an Add-in. Either the AutoClose VBA command or the PresentationClose event will provide the hook to hang your checking code on. Events: Make your VBA code in PowerPoint respond to events Add-ins: Create an ADD-IN with TOOLBARS that run macros

这篇关于在关闭带有IF条件的PowerPoint之前提示用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆