View Single Post
 
Old 04-25-2012, 07:49 PM
cyanosaur cyanosaur is offline Windows XP Office 2007
Novice
 
Join Date: Apr 2012
Posts: 1
cyanosaur is on a distinguished road
Default Need to create a folder in Outlook AND on the Hardrive at the same time.

Hello,

I have the VB script below running within Outlook 2007. It creates and names a folder after asking for some input from a user. I want to have this same script also create a matching folder with the same name on the hard drive in a destination chosen by dialog box. (hopefully could default to a specific folder like "My Documents".)

Can someone please modify my code replacing the peusdo-code (in red) with real working code? Thanks in advance!!

Sub CreateFolder()
Dim F As Outlook.MAPIFolder
Dim Name$
Set F = Application.Session.PickFolder
If F Is Nothing Then Exit Sub
Name1 = InputBox("Salesman Initials?")
If Len(Name1) = 0 Then Exit Sub
Name2 = InputBox("Project?")
If Len(Name2) = 0 Then Exit Sub
Name = Format(Date, "yyyymmdd") & "-SALES-" & Name1 & "-" & Name2
F.Folders.Add Name
End Sub

Sub CreateMatchingFolderOnHDSomewhere()
"Open a dialog, choose the destination for new folder..."
"Create new folder assigning the same name as the above sub-routine"
End Sub
Reply With Quote