Creare outlook folder in VB.NET

PLCITS used Ask the Experts™
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")
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Éric MoreauSenior .Net Consultant
Top Expert 2016

have you tried GetRootFolder ?
Top Expert 2016

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

Open in new window


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial