I have an Excel VBA application in which I open Outlook and create a folder. However, I would like to create a subfolder from the main folder but don't seem to be able to do so. Can anyone help ? My current code is below....
Answer = MsgBox("Create a new Outlook folder ?", vbYesNoCancel)
If Answer = vbYes Then
OutlookFolderName = teOrderNo & " " & coClientName & " - " & coHeading
Set ol = CreateObject("Outlook.Application")
Set ns = ol.GetNamespace("MAPI")
ParentFolder = "Personal Folders"
MainFolder = "_Toco Orders"
Set fl = ns.Folders.Item(ParentFolder).Folders.Item(MainFolder)
fn = OutlookFolderName
If Len(fn) > 0 Then
Set mf = fl.Folders.Add(fn)
Set mf = Nothing
Set fl = Nothing
Set ns = Nothing
Set ol = Nothing
MsgBox "A new Outlook folder has been created successfully", vbInformation