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: 

Lost mails when using outlook to read then

When I use the example VI attached(copyed from message four in https://forums.ni.com/t5/LabVIEW/ActiveX-Read-Outlook-Calendar-and-Task-List/m-p/1186647)

this example doesnot work well on my PC,It strucked when meet a 'meeting' in the Inbox,and just list 6 mails in the VI's pannel.

After I add a 'error cleaning' block ,it can list more message,

cleaning.jpg

but it is still a little strange. I can see there are 145 mails in Inbox at OutLook, see as below:

总数.jpg

but this VI tells me there are 222mails in the Inbox,see as below:

2.png

Things worse are that , the mails list are not coressponding to the fact, the top several mails are missing,see below:

3.png

 

I am also puzzled with the Activex close block, from 

https://forums.ni.com/t5/LabVIEW/Get-Outlook-Emails-by-Date-Received-using-ActiveX/m-p/3644303 ,

message 4,I see that ,the close block just beside the creat block. But ,from another blog 

https://forums.ni.com/t5/LabVIEW/Method-of-tracking-and-closing-ActiveX-references-in-reverse/m-p/35...

it(the use of 'close') may not be so simple.

And even ,some VIs do not close the ActiveX at all ,see in the attached example, as well as in below:

4.png

So , I modified the attached when I use it ,as below:

5.jpg

Is it necessary or correct ?

0 Kudos
Message 1 of 6
(2,583 Views)

I have found that certain types of emails, for example ones that have calendar entries, will cause all subsequent emails in the inbox to show up a empty strings.

0 Kudos
Message 2 of 6
(2,450 Views)

Yes, the reason you will have lost emails is because some emails such as calendar invites use a different activeX class, in the calendar invite case the ActiveX class used is: outlook apointment item. This will trigger an error  because you use a different class (error 3008) and due to your shift register it will propagate to the other email reads in the loop, due to how LabVIEW is, functions are set up to do nothing if they receive an error and this will cause you a blank result even if the program can see that there are say 50 emails and loops 50 times. Simply just replace the error shift register in the for loop with a tunnel and this should go away. I had this problem too but I found this post: 

https://forums.ni.com/t5/LabVIEW/ActiveX-Read-Outlook-Calendar-and-Task-List/m-p/3673248/highlight/f...

 

0 Kudos
Message 3 of 6
(2,208 Views)

@captainfungus wrote:

Yes, the reason you will have lost emails is because some emails such as calendar invites use a different activeX class, in the calendar invite case the ActiveX class used is: outlook apointment item. This will trigger an error  because you use a different class (error 3008) and due to your shift register it will propagate to the other email reads in the loop, due to how LabVIEW is, functions are set up to do nothing if they receive an error and this will cause you a blank result even if the program can see that there are say 50 emails and loops 50 times. Simply just replace the error shift register in the for loop with a tunnel and this should go away. I had this problem too but I found this post: 

https://forums.ni.com/t5/LabVIEW/ActiveX-Read-Outlook-Calendar-and-Task-List/m-p/3673248/highlight/f...

 


This is BAD advice.  You have the potential to swallow important errors.  HANDLE ERRORS PROPERLY.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(2,194 Views)

well... I was just suggesting an easy fix to his code and explaining why it does not work at the moment, I am sure there are better ways of doing this

FYI the only potential errors you will get there are the use of the wrong ActiveX class - such as calendar invites which you want to ignore anyway, so it really does not matter.

0 Kudos
Message 5 of 6
(2,187 Views)

@captainfungus wrote:

well... I was just suggesting an easy fix to his code and explaining why it does not work at the moment, I am sure there are better ways of doing this

FYI the only potential errors you will get there are the use of the wrong ActiveX class - such as calendar invites which you want to ignore anyway, so it really does not matter.


I see.  Whenever offering "shortcut" advice to an inexperienced programmer, I always explain what the shortcut is, and why the shortcut is okay in the specific case.  Now that you've explained why it's okay to ignore any errors encountered, I feel better about the advice.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 6
(2,183 Views)