Creare outlook folder in VB.NET

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

Do more with

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

Commented:
have you tried GetRootFolder ?
Top Expert 2016
Commented:
Hi,

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

Open in new window

Regards

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