Creare outlook folder in VB.NET

Im trying to create a folder in outlook but the same level as inbox, is possible?   somebody can give me some directions

here is the code implaying

        Dim myNameSpace As Microsoft.Office.Interop.Outlook.NameSpace
        Dim myFolder As Microsoft.Office.Interop.Outlook.Folder
        Dim myNewFolder As Microsoft.Office.Interop.Outlook.Folder
        Dim objApp As Microsoft.Office.Interop.Outlook.Application 'Outlook Application

        objApp = New Microsoft.Office.Interop.Outlook.Application 'Create Outlook Instance
        myNameSpace = objApp.GetNamespace("MAPI") 'Get Appropriate Outlook Namespace

        myFolder = myNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox)
        myNewFolder = myFolder.Folders.Add("My folder")
PLCITSAsked:
Who is Participating?
 
Rgonzo1971Commented:
Hi,

pls try
myNewFolder = myFolder.Parent.Folders.Add("My folder")

Open in new window

Regards
0
 
Éric MoreauSenior .Net ConsultantCommented:
have you tried GetRootFolder ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.