Macro to create a new folder with subject line as the folder name

Status
Not open for further replies.

StingOM

Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
Hi Folks,

I am new to this forum. I hoping that someone would be generous with their time to help me create a macro that will create a new folder in Outlook and extract the content of the subject line as the name of the new folder.

I work in an environment with hundreds of emails and it would be nice if I can filter out emails from clients looking for a new quote for a job.

The code I found on the web is a basic start. However, I don't know enough VB programming to modify the script for my needs:

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 = "Quote - " & "-" & Name

F.Folders.Add Name

End Sub

My wish list:

1) An option (pop up menu) to allow me to confirm or modify the new folder name after the text extracted from the subject line

or

2) An option to append the subject line text content to a prefix of folder name as already shown in the code above.

and

3) An option to pre-define where the new folder should be created.

4) An option to move a selected message or a set of selected messages automatically into this new folder.

5) Open this new folder, after it is created and the messages have been moved into it.

Thanks.

Si
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
To do everything it's going to be complicated - you'll need to either learn vba or be good at searching and know enough vba to put the macros together.




2) you'll reference the selected message then use something like Name = "Quote - " & item.subject




You'll need to use something like


Dim Item As Object






' get function from Outlook VBA: work with open item or selected item - Slipstick Systems


' if you want it to work with open or selected messages


Set Item = GetCurrentItem()




Name = "Quote - " & item.subject




4) this can be done with a For... Next statement



For Each item In Selection




' do whatever




Next






5) you'd use something like this to open a folder
Set Application.ActiveExplorer.CurrentFolder = Name






I have macros at slipstick.com that you can learn from (and use bits in your own macro) and Michael has some here: VBOffice - Samples - he has several that work with folders that you can learn from.




I think on #1, you could use a msgbox or an input box. #3 should be a feature of the folder picker, otherwise i don't know.
 

StingOM

Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
Many thanks. I will try to pull something together. :D
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A Outlook macro to create search folder with mail categories as criteria Outlook VBA and Custom Forms 3
B Macro To Create Rule To Export From Certain Folder Email Information in one workbook multiple sheets Outlook VBA and Custom Forms 0
M How to Create Macro in Visual Basic to add Contacts from Personal Folder Using Outlook 4
J Macro to create folder in PST file Outlook VBA and Custom Forms 4
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
A Create Macro for hyperlink(email) in message body Outlook VBA and Custom Forms 9
L Macro Create Contact and Save Using Outlook 2
L Macro Create Contact and Save Using Outlook 8
S Macro to create notification emails Using Outlook 1
N Macro to create task Using Outlook 1
P Please Help me Create a Macro ! Using Outlook 2
S Macro to create a new contact, 2 appointments, and a task Using Outlook 1
C Outlook VBA - Create Macro Move Contact field Item to Another Using Outlook 1
R How do I create a macro to put text in certain emails? Outlook VBA and Custom Forms 1
D Create a macro in Outlook to run a rule Outlook VBA and Custom Forms 32
N How Can I create an Outlook Macro to import calendar? Outlook VBA and Custom Forms 1
P How do I create a macro to add contacts from email messages? Outlook VBA and Custom Forms 1
G Macro: Create New Message and Auto populate To Field Outlook VBA and Custom Forms 5
S How to create a macro to insert a signature in Outlook 2007 Outlook VBA and Custom Forms 1
witzker HowTo start a macro with an Button in OL contact form Outlook VBA and Custom Forms 12
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 6
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
C Macro to extract sender name & subject line of incoming emails to single txt file Outlook VBA and Custom Forms 3
L Macro/VBA to Reply All, with the original attachments Outlook VBA and Custom Forms 2
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 4
U Macro for reminders,tasks,calendar Outlook VBA and Custom Forms 4
V macro runs slower on startup than after Outlook VBA and Custom Forms 3
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
A VBA macro for 15 second loop in send and received just for 1 specific mailbox Outlook VBA and Custom Forms 1
G VBA Macro Calendar Printing Assistant 4
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
M Outlook macro to automate search and forward process Outlook VBA and Custom Forms 6
R Macro Schedule every day in Outlook Using Outlook 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
Healy Consultants Macro to remove inside organization distribution list email address when reply to all recepients Outlook VBA and Custom Forms 0
geofferyh Cannot get Macro to SAVE more than one message attachment??? Outlook VBA and Custom Forms 5
N How can I increase/faster outlook VBA Macro Speed ? Using Outlook 2
4 Macro to set the category of Deleted Item? Outlook VBA and Custom Forms 2
D.Moore Folder view settings by VBA macro Outlook VBA and Custom Forms 57
Dave A Run macro on existing appointment when it changes Outlook VBA and Custom Forms 1
V Outlook Macro to show Flagged messages Outlook VBA and Custom Forms 2
O Run macro automatically at sending an email Using Outlook 11
R Retain Original Message When Forwarding With Macro Outlook VBA and Custom Forms 3
C Macro to add multiple recipients to message Outlook VBA and Custom Forms 3
B Reply and replyall macro is not working Outlook VBA and Custom Forms 1
O Macro - paste as plain text Outlook VBA and Custom Forms 2

Similar threads

Top