Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to open Outlook 2010 with selected a inbox sub folder from desktop appliation


VB
Dim app As Outlook.Application
          Dim ns As Outlook.NameSpace
          Dim siFolder As Outlook.Folder = Nothing

          app = New Outlook.Application()
          app = CreateObject("Outlook.Application")
          ns = app.GetNamespace("MAPI")
          Dim olFolders As Outlook.Folders = ns.Folders

          If CType(sender, Button).Tag.ToString = "Inbox" Then
              siFolder = CType(ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox), Outlook.Folder)
          Else
              siFolder = CType(ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Parent.folders("Sub Folder Name"), Outlook.Folder)
            
          End If
          System.Diagnostics.Process.Start("outlook")




This code is only working for In box not for Sub folder.


Please Help!

RKS
Posted
Updated 5-Jun-13 23:55pm
v3

1 solution

 
Share this answer
 
Comments
Rahul K Singh 6-Jun-13 1:57am    
Thanks for reply,

I have already searched the folders. Now I want to Select the specific Sub folder in Inbox.

-- -- RKS
Maciej Los 6-Jun-13 1:59am    
Have you read linked articles (especially second-one)?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900