Dear Woodytes,
Does Powerpoint support macros that, for example, run on creating or opening a file (like Word does) if so what are the names of these?
liz
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS PowerPoint and presentation apps » Automatic macros (2K)
Individual presentation files can have macros in them, it’s the global piece that’s hard to use.
If you are familiar with application level events in Word, PowerPoint has equivalents for many of them. Although more complex to use, they can take the place of AutoNew, AutoOpen, etc. Here’s an example: I want to copy a backup of presentations saved on our network server to my C drive. I need to set up an event procedure that recognizes when I’m closing a presentation. Here’s what I do.
Public WithEvents ppApp As PowerPoint.Application
Private Sub ppApp_PresentationClose(ByVal Pres As Presentation) End Sub
This is where I will put some code later. For quick reference, it ends up like this:
Private Sub ppApp_PresentationClose(ByVal Pres As Presentation) If MsgBox("Mirror presentation to your hard drive?", vbYesNo) _ = vbYes Then MirrorPres Pres End If End Sub
Dim PPevts As New clsPPTevents
Sub DoSetup() ' Snag application events Set PPevts.ppApp = PowerPoint.Application End Sub
Sub MirrorPres(ppFile As Presentation) FileCopy ppFile.FullName, Replace(ppFile.FullName, "L:", "C:PPT", , , vbTextCompare) End Sub
The timing on PowerPoint events is more crude than with Word and Excel, where you get options to do thing Before (such as BeforeSave, BeforeClose and BeforePrint), but it might suit your needs otherwise. Hope this helps.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications