Home»Tips»VB.NET»Open Outlook folder dialog and select folder using VB.NET
Open Outlook folder dialog and select folder using VB.NET
Author: Amrita Dash
Following is the code sample used to display the outlook folder dialog using VB.NET
[VB.NET CODE STARTS]
Dim objOutlook As Object Dim objOlNamespace As Object Dim objOlFolder As Object
objOutlook = CreateObject("Outlook.Application") ' create outlook application object at the run time objOlNamespace = objOutlook.GetNamespace("MAPI") objOlFolder = objContactsNS.PickFolder ' displays the folder dialog
[VB.NET CODE ENDS]
The [DefaultItemType] property of the outlook folder object can be used to check the outlook items type (contacts \ appointments \ tasks etc.)
For contacts [DefaultItemType] is 2 , similarly for appointments its 1 and tasks its 3.