how can i add a folder in outlook? in know that i have to do something like this:
but i don't know what i have to write instead of Something...VB Code:
Application.Namespace("Something").Folders.Add "FolderName"
Printable View
how can i add a folder in outlook? in know that i have to do something like this:
but i don't know what i have to write instead of Something...VB Code:
Application.Namespace("Something").Folders.Add "FolderName"
Here is how to create a new folder under the Inbox folder.
Code:Private Function CreateFolder()
'oApp - only if Outlook is not running. Otherwise use 'Application'
Dim oApp = New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oInbox As Outlook.MAPIFolder
Dim oNewFolder As Outlook.MAPIFolder
'Use only one - oApp or Application. See first comment.
'Connection object.
Set oNS = oApp.GetNamespace("MAPI")
Set oNS = Application.GetNamespace("MAPI")
'Connection to Inbox folder.
Set oInbox = oNS.GetDefaultFolder(olFolderInbox)
'Create new subfolder "NewFolder"
Set oNewFolder = oInbox.Folders.Add("NewFolder", olFolderInbox)
End Function
cool, how much trouble to add a folder!
thanks man!
Your welcome.
Just drill down the folder path to where ever you want to create
a folder. Even if its under the Public folders.