---
description: Some people desire to automatically or quickly create a new Outlook appointment when they flag an email. This article will introduce an approach to realize it with Outlook VBA.
title: How to Auto Create a New Appointment When an Email Is Flagged in Outlook
image: https://www.datanumen.com/blogs/wp-content/uploads/2016/12/Visual-Basic-Button.jpg
---

-
-
-

[Home](https://www.datanumen.com/blogs/) > [Solutions](https://www.datanumen.com/blogs/category/solutions/) > [Office Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/) > [Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) > How to Auto Create a New Appointment When an Email Is Flagged in Outlook

# How to Auto Create a New Appointment When an Email Is Flagged in Outlook

[Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) September 29, 2025

Share Now:

-
-
-
-
-
-
-
-

*Some people desire to automatically or quickly create a new Outlook appointment when they flag an email. This article will introduce an approach to realize it with Outlook VBA.*

Sometimes, I may receive an email which mentions an appointment or meeting. But it is just an email instead of a common meeting item in Outlook. In this case, I have to create a new appointment in my Outlook calendar manually. That’s a bit troublesome. So I wish that Outlook can automatically create a new appointment. Nevertheless, Outlook has no native support for us to create a new appointment automatically when we flag an email. Therefore, in order to achieve it, I choose to make use of Outlook VBA. Here are the detailed VBA codes and steps.

## **Auto Create a New Appointment When an Email Is Flagged**

1. In the first place, switch to “Developer” tab and hit “Visual Basic” button in “Code” group.![Visual Basic Button](https://www.datanumen.com/blogs/wp-content/uploads/2016/12/Visual-Basic-Button.jpg "Visual Basic Button")
2. Then in the new “Microsoft Visual Basic for Applications” window, you need to double click on “ThisOutlookSession” to open this project.
3. And next copy and paste the following VBA codes into it.

```
Public WithEvents olItems As Outlook.Items

Private Sub Application_Startup()
    Set olItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub olItems_ItemChange(ByVal Item As Object)
    Dim oAppt As AppointmentItem
    Dim strMsg As String
    Dim nRes As Integer
 
    On Error Resume Next
 
    If TypeName(Item) = "MailItem" And Item.IsMarkedAsTask = True Then
       strMsg = "Do you want to create a new appointment"
       nRes = MsgBox(strMsg, vbYesNo + vbQuestion, "Confirm Creating Appointment")
       If nRes = vbYes Then
          Set oAppt = Application.CreateItem(olAppointmentItem)
          With oAppt
               .Subject = "New Appt: " & Item.Subject
               .Location = InputBox("Enter the Location, please.")
               'Type the concrete time, such as "12/29/2015 15:30"
               .Start = InputBox("Enter a specific time (format: MM/DD/YYYY hh:mm), please.")
               .Duration = 120
               .Body = "New Appointment: " & vbCrLf & vbCrLf & Item.Body
               .Attachments.Add Item
               .ReminderSet = True
               .ReminderMinutesBeforeStart = 30
               'Use ".Save" to directly save the new appointment
               .Display
          End With
       End If
 
      'To clear the flag on the email
      'If you want to keep email flagged, remove the following 4 lines
       With Item
            .ClearTaskFlag
            .Save
       End With
    End If
End Sub
```

![Copy the VBA Codes into the ThisOutlookSession](<> "Copy the VBA Codes into the ThisOutlookSession")

4. Subsequently, you should use “Digital Certificate for VBA Projects” to create a new certificate and sign the current “ThisOutlookSession” project.![Digitally Sign the ThisOutlookSession Project](<> "Digitally Sign the ThisOutlookSession Project")
5. After that, you can exit the “Visual Basic” window and change macro settings to only permit digitally signed macros.![Only Permit Digitally Signed Macros](<> "Only Permit Digitally Signed Macros")
6. Eventually, you can have a try.

- Firstly, pitch on an email and click the “Flag” icon. You will get a prompt, like the following screenshot:![Confirm Creating Appointment](<> "Confirm Creating Appointment")
- After selecting “Yes”, you will be required to specify the location and hit “OK” button.![Enter the Locatiom](<> "Enter the Locatiom")
- Then you need to specify the appointment time.![Enter a specific time](<> "Enter a specific time")
- Finally, after clicking “OK”, a new appointment will open up, shown as the image below:![New Appointment](<> "New Appointment")

### **Notes:**

1. In this VBA codes, the reminder is set to 30 minutes by default. You can change it in the codes at will.
2. The codes set the appointment duration to 120 minutes, namely 2 hours. You can change the “.Duration = 120” line as per your needs.
3. If you didn’t specify a concrete time, the new appointment will be set to the current date and time by default.
4. You can add the “.Save” line to save the appointment directly.

## **Dispose of Outlook Problems**

It is known that Outlook can suffer various issues. The worst situation must be Outlook corruptions. If your Outlook file is corrupted and you’ve had a backup in hand, you can easily restore your [damaged Outlook data](https://www.datanumen.com/outlook-repair/) from backups. But if you have no backup, you will need to repair the corrupt Outlook file. In this case, you can use the built-in repair tool, Scapst.exe, or resort to a more experienced tool, like DataNumen Outlook Repair.

## **Author Introduction:**

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including [repair SQL Server mdf database problem](https://www.datanumen.com/sql-recovery/) and outlook repair software products. For more information visit [www.datanumen.com](https://www.datanumen.com)

Share Now:

-
-
-
-
-
-
-
-

[← Previous post](https://www.datanumen.com/blogs/2-tips-to-insert-footnotes-to-multi-column-pages-in-your-word-document/)

[Next post →](https://www.datanumen.com/blogs/quickly-create-contact-group-recipient-list-email-outlook-vba/)

Comments are closed.

![Data Recovery Blog]()

Follow or like us on Facebook, LinkedIn and Twitter to get all promotions, latest news and updates on our products and company.

-
-
-

### Featured Products

- [DataNumen Outlook Repair](https://www.datanumen.com/outlook-repair/)
- [DataNumen SQL Recovery](https://www.datanumen.com/sql-recovery/)
- [DataNumen Exchange Recovery](https://www.datanumen.com/exchange-recovery/)
- [DataNumen Access Repair](https://www.datanumen.com/access-repair/)
- [DataNumen Excel Repair](https://www.datanumen.com/excel-repair/)
- [DataNumen PDF Repair](https://www.datanumen.com/pdf-repair/)
- [DataNumen Word Repair](https://www.datanumen.com/word-repair/)
- [DataNumen Zip Repair](https://www.datanumen.com/zip-repair/)

### Popular posts

```json
{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/#article","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/"},"author":{"name":"AuthorCCW","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957"},"headline":"How to Auto Create a New Appointment When an Email Is Flagged in Outlook","datePublished":"2016-12-29T01:14:19+00:00","dateModified":"2025-09-29T10:59:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/"},"wordCount":498,"commentCount":1,"publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2016\/12\/Visual-Basic-Button.jpg","articleSection":["Outlook Solutions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/","url":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/","name":"How to Auto Create a New Appointment When an Email Is Flagged in Outlook","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/#primaryimage"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2016\/12\/Visual-Basic-Button.jpg","datePublished":"2016-12-29T01:14:19+00:00","dateModified":"2025-09-29T10:59:54+00:00","description":"Some people desire to automatically or quickly create a new Outlook appointment when they flag an email. This article will introduce an approach to realize it with Outlook VBA.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/auto-create-new-appointment-email-flagged-outlook\/#primaryimage","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2016\/12\/Visual-Basic-Button.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2016\/12\/Visual-Basic-Button.jpg","width":420,"height":131,"caption":"Visual Basic Button"},{"@type":"WebSite","@id":"https:\/\/www.datanumen.com\/blogs\/#website","url":"https:\/\/www.datanumen.com\/blogs\/","name":"Data Recovery Blog","description":"Discuss every aspect of data recovery","publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanumen.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanumen.com\/blogs\/#organization","name":"Data Recovery Blog","url":"https:\/\/www.datanumen.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","width":296,"height":397,"caption":"Data Recovery Blog"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataNumen","https:\/\/x.com\/DataNumen","http:\/\/www.linkedin.com\/company\/datanumen","https:\/\/myspace.com\/datanumen\/","http:\/\/www.pinterest.com\/datanumen\/","https:\/\/www.youtube.com\/channel\/UCVIIuuKfUBHSJauUaVP13tw"]},{"@type":"Person","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957","name":"AuthorCCW","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","caption":"AuthorCCW"},"sameAs":["https:\/\/www.datanumen.com\/"]}]}
```
