29 August 2006

VBScript : add folder to outlook

I just answered to a request on a mailing list. It looks simple to add a folder to the inbox, but I needed some time before getting it right..

On Error Resume Next

set olApp = CreateObject("Outlook.Application")
set inbox = olApp.GetNamespace("MAPI").getDefaultFolder(6)
set temp5 = inbox.folders.add("Added by vbscript",6)

6 is for the inbox

No comments: