Created
January 4, 2020 01:35
-
-
Save JohnLaTwC/7b04b027e7142cce18c1da9f61a29557 to your computer and use it in GitHub Desktop.
Journal addin for PowerPoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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