Macro to create a new folder in my personal folder

0

00033000

Pardon for asking if this is TOO basic a question, but I haven't been able to
find an example after much searching.

I want to create a Macro that will allow me to create a new folder (with the
current date) in my Personal folders:

Example:

US-C-20080704-

Ideally, a dialog box would open, allowing me to type in a description.
After clicking "OK", the resulting folder would look like this:

US-C-20080704-WhateverITyped

Does anyone have an example of how this would be coded in Outlook 2007?

Thanks!!
 
M

Michael Bauer [MVP - Outlook]

This should create a new folder in the folder you have to select:

Sub CreateFolder()
Dim F as Outlook.Mapifolder
Dim Name$

Set F=Application.Session.Pickfolder
If F is Nothing Then Exit Sub

Name=Inputbox("Name?")
If Len(Name)=0 then exit Sub

Name="US-C-" & Format(Date, "yyyymmdd") & "-" & Name
F.Folders.Add Name
End sub

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Sat, 5 Jul 2008 19:23:00 -0700 schrieb 00033000:
 
0

00033000

Thanks Michael,

This works perfectly!!!

Michael Bauer said:
This should create a new folder in the folder you have to select:

Sub CreateFolder()
Dim F as Outlook.Mapifolder
Dim Name$

Set F=Application.Session.Pickfolder
If F is Nothing Then Exit Sub

Name=Inputbox("Name?")
If Len(Name)=0 then exit Sub

Name="US-C-" & Format(Date, "yyyymmdd") & "-" & Name
F.Folders.Add Name
End sub

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Sat, 5 Jul 2008 19:23:00 -0700 schrieb 00033000:
 
Top