Consulting

Results 1 to 5 of 5

Thread: Using excel to get email dates from Lotus Notes

  1. #1
    VBAX Newbie
    Joined
    Oct 2012
    Posts
    3
    Location

    Using excel to get email dates from Lotus Notes

    Hi, i am trying to get the date from the emails in Lotus notes.

    I can connect and get a lot of informations already but cant get the date of the email. Any help?

    [VBA]
    Sub MailScan()
    Dim noSession As Object
    Dim noDatabase As Object
    Dim noView As Object
    Dim noDocument As Object
    Dim noNextDocument As Object
    Dim i As Integer

    'Embedded objects are of the datatype Variant.
    Dim vaItem As Variant
    Dim vaAttachment As Variant
    Dim aux2 As String
    Dim aux As String

    'Instantiate the Notes session.
    Set noSession = CreateObject("Notes.NotesSession")

    'Instantiate the actual Notes database.
    '(Here is the personal e-mail database used and since it's a
    'local database no reference is made to any server.)
    Set noDatabase = noSession.GETDATABASE("xxx", "xxx")

    'Folders are views in Lotus Notes and in this example the Inbox is used.
    Set noView = noDatabase.GetView("($Inbox)")

    'Get the first document in the defined view.
    Set noDocument = noView.GetFirstDocument
    aux = noDocument.GetItemValue("Subject")(0) [/VBA]


    I can get the Subject as You can see in the last line.


    Any help would be apreciated.

  2. #2
    VBAX Newbie
    Joined
    Oct 2012
    Posts
    3
    Location
    Anyone can help?

    i tried to use [VBA]noDocument.Created[/VBA] but when i move this email to a folder, it chages the date.

    Anyone knows how to get the correct date of arrival of the email independently of folder?

    Quote Originally Posted by suhr
    Hi, i am trying to get the date from the emails in Lotus notes.

    I can connect and get a lot of informations already but cant get the date of the email. Any help?

    [vba]
    Sub MailScan()
    Dim noSession As Object
    Dim noDatabase As Object
    Dim noView As Object
    Dim noDocument As Object
    Dim noNextDocument As Object
    Dim i As Integer

    'Embedded objects are of the datatype Variant.
    Dim vaItem As Variant
    Dim vaAttachment As Variant
    Dim aux2 As String
    Dim aux As String

    'Instantiate the Notes session.
    Set noSession = CreateObject("Notes.NotesSession")

    'Instantiate the actual Notes database.
    '(Here is the personal e-mail database used and since it's a
    'local database no reference is made to any server.)
    Set noDatabase = noSession.GETDATABASE("xxx", "xxx")

    'Folders are views in Lotus Notes and in this example the Inbox is used.
    Set noView = noDatabase.GetView("($Inbox)")

    'Get the first document in the defined view.
    Set noDocument = noView.GetFirstDocument
    aux = noDocument.GetItemValue("Subject")(0) [/vba]


    I can get the Subject as You can see in the last line.


    Any help would be apreciated.

  3. #3
    Try PostedDate (or DeliveredDate):
    [vba]
    noDocument.GetItemValue("PostedDate")(0)[/vba]

  4. #4
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    I suppose you have a reference to the notes.dll.
    In that case you can use the object browser (in the VBEditor F2) to find what you are looking for.

  5. #5
    VBAX Newbie
    Joined
    Oct 2012
    Posts
    3
    Location
    Worked!

    Thanks everyone.


    Quote Originally Posted by Crocus Crow
    Try PostedDate (or DeliveredDate):
    [vba]
    noDocument.GetItemValue("PostedDate")(0)[/vba]

Posting Permissions

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