From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Outlook Emails by Date Received using ActiveX

Solved!
Go to solution

Hello!

So I am trying to write a VI that will pull emails from an inbox in Outlook and get the subject and message from each email. My dilemma is that I don't want to pull all emails from the inbox each time I run the VI; Instead, I would like to store the date and time that the VI was last ran or of the latest email it pulled and then use that for the next time it is ran to determine what emails are "new" and only pull those. Is this possible? 

0 Kudos
Message 1 of 8
(3,521 Views)

Yes


GCentral
0 Kudos
Message 2 of 8
(3,496 Views)

I see you posted a picture, but its not showing up.

0 Kudos
Message 3 of 8
(3,475 Views)
Solution
Accepted by topic author ebohannon

I took an example from this thread and added checking of what time it is. You could do something like this. Just go through each email, check what time it was created, and when you get to the time you saved that you last checked, then stop.

Outlook Mail Example.png

 

--Hope

Message 4 of 8
(3,460 Views)

You could log a timestamp to a file every time you run the application. Check that file and you know the time of the last execution.

Message 5 of 8
(3,443 Views)

Awesome I will give this a try! Thank you!

0 Kudos
Message 6 of 8
(3,432 Views)

Worked like a charm Hope thanks! W_Smith thanks for the advice! I was able to save the time stamp to a file to use each time I run the program to get the last time ran so that solves all my questions! Thanks again you two! 

0 Kudos
Message 7 of 8
(3,423 Views)

Awesome. Glad I could help. Best regards!

0 Kudos
Message 8 of 8
(3,419 Views)