PDA

View Full Version : Using excel to get email dates from Lotus Notes



suhr
10-31-2012, 07:09 AM
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?


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)


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


Any help would be apreciated.

suhr
11-05-2012, 06:58 AM
Anyone can help?

i tried to use noDocument.Created 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?


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?


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)


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


Any help would be apreciated.

Crocus Crow
11-05-2012, 04:23 PM
Try PostedDate (or DeliveredDate):

noDocument.GetItemValue("PostedDate")(0)

snb
11-06-2012, 01:17 AM
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.

suhr
11-07-2012, 03:26 AM
Worked!

Thanks everyone.



Try PostedDate (or DeliveredDate):

noDocument.GetItemValue("PostedDate")(0)