Last reviewed on April 23, 2015   —  4 Comments

This series of Word macros will create a new Journal entry in Outlook 2013 when you create a new Word document or open an existing Word document. It also reminds you to close the Journal item when you are done editing. A similar macro can be used with Excel.

To use, paste the code into Word's VB Editor and set a reference to the Outlook object model in Tools > References.

Set a reference to Outlook in Word's VB Editor

Sub autonew()

 Dim ol As New Outlook.Application
 Dim oJournal As JournalItem
 Dim fName As String
 
    fName = InputBox("Enter a Filename", "Subject")
    ActiveDocument.SaveAs fName
 
 Set oJournal = ol.CreateItem(olJournalItem)

 With oJournal
    .Subject = fName
    .Categories = "new doc"
    .Type = "Microsoft Word"
    .StartTimer
    .Save
    .Display
 End With
 
 Set ol = Nothing
 Exit Sub
UserCancelled:
 Set ol = Nothing
 End Sub


Sub autoopen()

 Dim ol As New Outlook.Application
 Dim oJournal As JournalItem
 Dim fName As String
 
 fName = ActiveDocument.Name
 
 Set oJournal = ol.CreateItem(olJournalItem)

 With oJournal
    .Subject = fName
    .Categories = "open doc"
    .Type = "Microsoft Word"
    .StartTimer
    .Save
    .Display
 End With
 
 Set ol = Nothing
 Exit Sub
UserCancelled:
 Set ol = Nothing
 End Sub

Sub autoclose()
MsgBox "Don't forget to close the journal!"
End Sub


Comments

    • Diane PoremskyDiane Poremsky says

      In word, press Alt+F11 to open it's VBA editor and add it to the template then save.

    • Diane Poremsky says

      The Windows Journal? Hit the Windows key on your keyboard and type journal to find the windows journal - then just start typing.
      The Outlook Journal folder (what this article is about) is on Outlook's Folder list.

Leave a Reply

Please post long or more complicated questions at OutlookForums by Slipstick.com.

If the Post Comment button disappears, press your Tab key.