How to create a drop-down list for subjects in Outlook?
You may have different preset email subjects that need to be distributed to different recipients in Outlook. It would be very efficient to have a subject line drop-down list for selecting a subject without typing it manually when composing an email. Just like the gif demonstrated below. This tutorial provides three VBA codes to help you create a drop-down list with different preset subjects. When composing an email, you can select any subject you need from the drop-down to automatically fill in the subject line. Please follow the step-by-step guide to get it done.
Create a drop-down list for subjects in Outlook with VBA code
Actually, Outlook does not allow to add a drop-down list in the subject line. Here you need to create a user form and combine it with VBA codes to complete it.
1. Launch your Outlook, press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, click Insert > UserForm.
3. Then the UserForm1 is inserted under Project1 in the left pane of the Visual Basic editor. You need to add a combo box and a command button to this userform by dragging the ComboBox and CommandButton respectively from the Toolbox to the UserForm1.
4. Right click the command button and select Properties in the right-click menu.
5. In the Properties – CommandButton1 pane, change the Caption field to OK. This action will change the text displayed on the command button.
6. Double click on the blank area in the UserForm to open the corresponding UserForm (Code) window, then replace the existing code with the following VBA code.
VBA code 1: UserForm with a drop-down list including multiple preset email subjects
Private Sub UserForm_Initialize()
'Updated by Extendoffice 20220927
With ComboBox1
.AddItem "Subject 1"
.AddItem "Subject 2"
.AddItem "Subject 3"
.AddItem "Subject 4"
.AddItem "Subject 5"
.AddItem "No change"
End With
End Sub
Private Sub CommandButton1_Click()
GCbbIndex = ComboBox1.ListIndex
GSelSubject = ComboBox1.Value
Unload Me
End Sub
Note: In the code, the Subject 1, 2, 3, 4 and 5 are the preset email subjects you want to use in your emails. “No change” means not change anything of the existing email subject. You can change the preset email subjects in the VBA code according to your needs.
7. Double click Project1 > Microsoft Outlook Objects > ThisOutlookSession. Then copy the following VBA code into the ThisOutlookSession (Code) window.
VBA code 2 used in the ThisOutlookSession window
Public WithEvents GExplorer As Explorer
'Updated by Extendoffice 20220927
Private Sub Application_Startup()
Set GExplorer = Application.ActiveExplorer
End Sub
Private Sub GExplorer_InlineResponse(ByVal Item As Object)
Set GInlineMail = Item
End Sub
8. Go on clicking Insert > Module in the Visual Basic editor. Then copy and paste the following VBA code into the Module (Code) window.
VBA code 3 used in the Module window
Public GCbbIndex As Long
'Updated by Extendoffice 20220927
Public GSelSubject As String
Public GInlineMail As MailItem
Public Sub ChangeSubject()
Dim xItem As MailItem
Dim xMail As Outlook.MailItem
On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set xMail = GInlineMail
Debug.Print "Explorer"
Case "Inspector"
Set xMail = Application.ActiveInspector.CurrentItem
Debug.Print "Inspector"
End Select
UserForm1.Show
If (GCbbIndex <> -1) And (GSelSubject <> "no change") Then
xMail.Subject = GSelSubject
End If
End Sub
9. Save the codes and press the Alt + Q keys to close the Visual Basic Editor window and return to Outlook application.
10. Click the New Email button under the Home tab to create an email.
11. In the new message window, click Customize Quick Access Toolbar > More Commands.
12. In the Outlook Options dialog box, you need to configure as follows.
13. Then you can see that a button has been added to the ribbon of the message window.
14. Now you need to restart your Outlook.
15. When composing an email message, if you need to insert a preset subject, you just need to click on the newly added button on the ribbon to display the user form, select a subject from the drop-down menu, and then click the OK button to populate it into the subject line.
Notes:
Best Office Productivity Tools
Kutools for Outlook - Over 100 Powerful Features to Supercharge Your Outlook
📧 Email Automation: Out of Office (Available for POP and IMAP) / Schedule Send Emails / Auto CC/BCC by Rules When Sending Email / Auto Forward (Advanced Rules) / Auto Add Greeting / Automatically Split Multi-Recipient Emails into Individual Messages ...
📨 Email Management: Easily Recall Emails / Block Scam Emails by Subjects and Others / Delete Duplicate Emails / Advanced Search / Consolidate Folders ...
📁 Attachments Pro: Batch Save / Batch Detach / Batch Compress / Auto Save / Auto Detach / Auto Compress ...
🌟 Interface Magic: 😊More Pretty and Cool Emojis / Boost Your Outlook Productivity with Tabbed Views / Minimize Outlook Instead of Closing ...
👍 One-click Wonders: Reply All with Incoming Attachments / Anti-Phishing Emails / 🕘Show Sender's Time Zone ...
👩🏼🤝👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails / Split a Contact Group to Individual Groups / Remove Birthday Reminders ...
Over 100 Features Await Your Exploration! Click Here to Discover More.



