• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

[EXCEL VBA] Extracting Email Body, Subject, Recipient, PostedDate and Sender of emails from Lotus Notes

Nimrod0202

New Member
Need help to extract body, subject, sendTo, From, PostedDate of emails in a folder from Lotus notes into excel. Saw below code from an old thread but only gets the body of a currently open email. Thank you in advance.

>>> use code - tags <<<
Code:
Public Sub Lotus_Notes_Current_Email()


Dim NSession As Object 'NotesSession
Dim NUIWorkspace As Object 'NotesUIWorkspace
Dim NUIDoc As Object 'NotesUIDocument
Dim NItem As Object 'NotesItem

Set NSession = CreateObject("Notes.NotesSession")
Set NUIWorkspace = CreateObject("Notes.NotesUIWorkspace")

Set NUIDoc = NUIWorkspace.CurrentDocument
If Not NUIDoc Is Nothing Then
With NUIDoc.Document
Set NItem = .GetFirstItem("Body")
If Not NItem Is Nothing Then
MsgBox prompt:=NItem.Text, Title:=.GetItemValue("Subject")(0)
End If
End With
Else
MsgBox "Lotus Notes is not displaying an email"
End If

Set NUIDoc = Nothing
Set NUIWorkspace = Nothing
Set NSession = Nothing

End Sub
 
Last edited by a moderator:
Back
Top