Skip to content

Instantly share code, notes, and snippets.

@JohnLaTwC
Created January 3, 2020 21:42
Show Gist options
  • Save JohnLaTwC/61d903e9adb72fab7addc9781030086a to your computer and use it in GitHub Desktop.
Save JohnLaTwC/61d903e9adb72fab7addc9781030086a to your computer and use it in GitHub Desktop.
Add Word doc to Journal
' 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