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:
 
Joined
May 4, 2012
Messages
1
Reaction score
0
Is it possible to simultaneously create a folder on the C drive somewhere using the same name?

How would that look in code?

Thanks!


> 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:
>
> > 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!!

>[/color][/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top