Link to home
Create AccountLog in
Avatar of PLCITS
PLCITS

asked on

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")
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

have you tried GetRootFolder ?
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer