Type Outlook.Folder is not defined

Add-in Express™ Support Service
That's what is more important than anything else

Type Outlook.Folder is not defined
Outlook.Folder in ADX COM AddIn 
mdfrt


Guest


Imports System.Windows.Forms
Imports Microsoft.Office.Interop.Outlook
.................
 Dim folder As Outlook.Folder = TryCast(Application.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderTasks), Outlook.Folder)
        For Each cItem As Outlook.TaskItem In folder.Items
            Dim body As [String]
            If cItem.Body IsNot Nothing Then
                body = cItem.Body
                MessageBox.Show(body.ToString)         
            End If
        Next

.................
I try to retrive a list of tasks from the Outlook.
The code above works well when I'm doing a New Outlook AddIn from VS2010 default template but I got "Type Outlook.Folder is not defined" in your ADX COM AddIn.
X
LATER EDIT:
:| fixed somehow, found your way to access the MAPI folder
Posted 04 Sep, 2010 01:41:27 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hi mdfrt,

This occurs because the Outlook version-neutral interop doesn't contain the definition of the Folder class (introduced in Outlook 2007).

I suppose you found http://www.add-in-express.com/docs/net-designers.php#interop-assemblies, correct?

Another usful article in your case would be http://www.add-in-express.com/creating-addins-blog/2010/03/16/interop-assemblies-late-binding/.

Good luck!


Andrei Smolin
Add-in Express Team Leader
Posted 06 Sep, 2010 05:24:37 Top