Reputation: 3453
I need help or sample code in VB.NET to read a specified outlook folder that is not the inbox or a subfolder of inbox
Say folder name is "foo", how can I rerieve emails with a LINQ query, possibly adding where clause(s) for the from, to, date, subject or body content.
Thanks :-)
Upvotes: 0
Views: 1185
Reputation: 66341
No offense, but when you have a hammer, everything looks like a nail :-)
Why does it need to be LINQ? It might look neat in you source code, but it can bring your application down to its knees - if you need any kind of restriction, use the native methods whenever you can. In your case, that would be Items.Find/FindNext/Restrict
.
If you need to access an arbitrary folder, use the Namespace.Folders
collection – it contains top level folders from all stores.
If the folder is on the same level as the Inbox, use Inbox.Parent.Folders
collection.
Upvotes: 2
Reputation: 951
You can use the following.
http://www.nuget.org/packages/scipbe.common.office/
Add it to your project and you can use linq like syntax with outlook.
Also
Upvotes: 0