Skip to content

Instantly share code, notes, and snippets.

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