Created
January 3, 2020 21:42
-
-
Save JohnLaTwC/61d903e9adb72fab7addc9781030086a to your computer and use it in GitHub Desktop.
Add Word doc to Journal
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/ | |
' and https://www.msoutlook.info/question/432 | |
' 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 = "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