Results 1 to 5 of 5
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Journal Template (2002/SP3)

    I'd like to make a journal template that automatically sets the current date and time on use.
    I can make a template - but entries based on the template have the date and time the template was saved.

    Any suggestions?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Journal Template (2002/SP3)

    Catharine <img src=/S/innocent.gif border=0 alt=innocent width=20 height=20>, not sure what you are after - did you look at the JournalItem Properties? They include .CreationTime, .Start, .Duration and .End. See MSDN Outlook 2003 JournalItem Object
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Journal Template (2002/SP3)

    Thanks - that did the trick!
    This is what I came up with:
    <pre>Sub CreateMyJournalEntry()

    Dim myolApp As Outlook.Application
    Dim myItem As Outlook.JournalItem
    Dim stCurDateTime As String
    Dim dtCurDateTime As Date

    stCurDateTime = Date & " " & Time
    dtCurDateTime = CDate(stCurDateTime)

    Set myolApp = CreateObject("Outlook.Application")
    Set myItem = myolApp.CreateItemFromTemplate("pathtotemplatehere mytemplate.oft")

    With myItem
    .Subject = "mysubject whatever"
    .Start = dtCurDateTime
    .StartTimer
    End With
    myItem.Display
    End Sub
    </pre>

    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Journal Template (2002/SP3)

    Out of curiosity, is there a reason you build the date and time that way?

    Dim dtCurDateTime As Date
    dtCurDateTime = Date + Time

    should work, since

    Date Data Type
    Date variables are stored as IEEE 64-bit (8-byte) floating-point numbers that represent dates ranging from 1 January 100 to 31 December 9999 and times from 0:00:00 to 23:59:59.


    and '?Format(Date + Time, "mm/dd/yyyy hh:mm:ss")' works fine in the Immediates window.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Journal Template (2002/SP3)

    No reason, just a leftover from trying to use a string only at first.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •