Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I capture the "SENT" time in Outlook.

    I am using Outlook 98, Access 97 and I have a question about capturing the "SENT" time to a database. I am trying to use this code: set nms2= application.CreateItem(0)
    Rst.fields(11).value = nms2.Sent

    In a way it works because it will enter the time as 12:00 am all the time. Does anyone have any better ideas or recommendations?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: How do I capture the

    Hi Daniel,
    The problem, as I see it, is twofold:
    1. Your item hasn't been sent (at least from that code)
    2. The Sent property returns a Boolean value indicating whether the item has been sent, not a date (you need SentOn), which in this case is False so returns 0, which is being interpreted as midnight!
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I capture the

    In my previous entry I was using "nms2.Sent" and at your suggestion I changed it to "nms2.SentOn". This is a little better as I am now geting "1/1/4501" in the db. As you can see I am not a "real" programmer (yet), but someday I hope to learn how to spell VB.

    Rst.AddNew
    set nms2= application.CreateItem(0)
    Rst.fields(11).value = nms2.SentOn
    Rst("Tasknum") = Counter
    Rst("txtstatus") = "Submit"
    Rst.fields(4).value=vrUser
    Rst.Update
    Rst.Close
    MyDB.Close

    Thank you for your help.

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: How do I capture the

    Hi Daniel,
    I think 1/1/4501 is a hypothetical maximum date assigned to the senton property as the item hasn't actually been sent yet. If you're going to send the item at the same time, I'd probably use the CreationDate property as to get the SentOn property after sending I think you'll have to reset the reference to the item because it has now moved to the sentitems folder!
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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