Skip to content

Instantly share code, notes, and snippets.

@JohnLaTwC
Created January 4, 2020 01:35
Show Gist options
  • Save JohnLaTwC/7b04b027e7142cce18c1da9f61a29557 to your computer and use it in GitHub Desktop.
Save JohnLaTwC/7b04b027e7142cce18c1da9f61a29557 to your computer and use it in GitHub Desktop.
Journal addin for PowerPoint
' Author: @JohnLaTwC
' You can recreate Journal for PPT files by the following. This will create journal entries every time you open a PPT file.
' STEPS:
' Create a presentation. Insert a Class named clsEvent with the following code:
Public WithEvents PPTEvent As Application
Private Sub PPTEvent_AfterPresentationOpen(ByVal Pres As Presentation)
RecordJournalEntry (ActivePresentation.Name)
End Sub
' Inspired from https://social.msdn.microsoft.com/Forums/sqlserver/en-US/60d484d9-e624-4624-982b-40c817e060da/powerpointpresentation-capturing-durations-of-slides-and-innerslide-animations-at?forum=isvvba
' Inspired from https://www.slipstick.com/outlook/journal/create-journal-entry-word-documents-outlook-2013/
' https://twitter.com/JohnLaTwC/status/1213215099789332480
' By: @JohnLaTwC (1/3/2020)
Sub RecordJournalEntry(fName)
Const olJournalItem = 4
Dim ol
Set ol = CreateObject("Outlook.Application")
Dim oJournal
Set oJournal = ol.CreateItem(olJournalItem)
With oJournal
.Subject = fName
.Categories = "PPT" ' must create category
.Type = Application.Name
.Body = ActivePresentation.Path & "\" & fName
End With
oJournal.Close (olSave)
Set ol = Nothing
End Sub
'' Then Insert a module with the following code:
Dim cPPTObject As New clsEvent
Sub Auto_Open()
Set cPPTObject.PPTEvent = Application
End Sub
'' Then save this as a PPAM (PowerPoint Addin with Macros) in %APPDATA%\Microsoft\AddIns
'' Then go into Options-> Addins -> Manage "PowerPoint Add-ins" Go
'' Select the PPAM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment