Created
January 3, 2020 21:27
-
-
Save JohnLaTwC/e158a521b131e260512053b85fa0b9ef to your computer and use it in GitHub Desktop.
Word Add to Journal feature
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
' Inspired from https://www.slipstick.com/outlook/journal/create-journal-entry-word-documents-outlook-2013/ | |
' By: @JohnLaTwC (1/3/2020) | |
Sub RecordJournalEntry(fName) | |
Const olJournalItem = 4 | |
Const olByReference = 4 | |
Dim ol | |
Set ol = CreateObject("Outlook.Application") | |
Dim oJournal | |
Set oJournal = ol.CreateItem(olJournalItem) | |
With oJournal | |
.Subject = fName | |
.Categories = "open file" | |
.Type = Application.Name | |
.Body = ActiveDocument.Path & "\" & ActiveDocument.Name | |
End With | |
oJournal.Close (olSave) | |
Set ol = Nothing | |
End Sub | |
Sub AutoOpen() | |
RecordJournalEntry (ActiveDocument.Name) | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment