CreateItem(OlJournalEntry) in StartUp

  • Thread starter Thread starter ttiefenbach
  • Start date Start date
T

ttiefenbach

In my 'ThisOutlookSession' I have the following code:

Private Sub Application_Startup()
Set MyObject = Application.CreateItem(olJournalItem)
MyObject.Type = "EventLog"
MyObject.Subject = "LogOn " & Time
MyObject.Start = Date & " " & Time
MyObject.Save
End Sub

Private Sub Application_Quit()
Set MyObject = Application.CreateItem(olJournalItem)
MyObject.Type = "EventLog"
MyObject.Subject = "LogOff " & Time
MyObject.Start = Date & " " & Time
MyObject.Save
End Sub

However, this doesn't seem to work. The entries are never created.
How can I get this to work? I'm using Outlook 2000 in WIN98.

Thanks for your help
 
My Outlook starts on startup, and no journal entry is created. It
starts minimized, if that matters. It does not create the entry if I
shut down, or restart, the computer without shutting down outlook
first, even though when you shut down the pc outlook does it's log off
sequence, outlook doesn't create the logoff entry.

However, if I log off from Outlook, the entry is created. If I start
Outlook after the computer starts up, outlook will create the entry.

Any ideas are appreciated.
 
For one thing you can't use Application_Quit. By the time it fires all
Outlook objects are out of scope. Do you have any better luck with the
code in Application_Startup if you Dim your journal item object?
 
Back
Top