Outlook Automation logo

Outlook Automation

Community
tamirdresher
outlook-automation

Control Microsoft Outlook on Windows via COM automation. Use when the user wants to create meetings, send emails, search emails, read inbox, manage calendar events, or interact with Outlook in any way. Triggers on phrases like "create meeting", "send email", "search emails", "check inbox", "calendar", "schedule", "outlook".

Overview

Publishertamirdresher
Repositorysquad-skills
Skill nameoutlook-automation
Stars
44
Forks
9
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by tamirdresher on GitHub. Read the source before you install it.

Installation

Install the Outlook Automation AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/tamirdresher/squad-skills/tree/main/plugins/outlook-automation
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tamirdresher/squad-skills.git /tmp/squad-skills
mkdir -p .claude/skills
cp -r /tmp/squad-skills/plugins/outlook-automation .claude/skills/outlook-automation
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Outlook Automation in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Outlook Automation on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Outlook Automation is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Outlook Automation (Windows COM)

When to Use

  • User wants to create, update, or delete calendar meetings/appointments
  • User wants to send, read, search, or manage emails
  • User wants to interact with Outlook contacts, folders, or tasks
  • Any request involving Outlook data or actions on Windows

When Not to Use

  • User is on macOS or Linux (COM is Windows-only)
  • User wants cloud-only access without local Outlook installed (use Microsoft Graph API instead)
  • Outlook is not installed on the machine

Prerequisites

  • Windows with Microsoft Outlook installed and configured with an account
  • PowerShell (available by default)

Core Concepts

Outlook COM exposes these key object types:

OlItemType ValueTypeDescription
0MailItemEmail messages
1AppointmentItemCalendar events / meetings
2ContactItemContacts
3TaskItemTasks
4JournalItemJournal entries
6NoteItemNotes

Folder Constants (OlDefaultFolders)

ValueFolder
3olFolderDeletedItems
4olFolderOutbox
5olFolderSentMail
6olFolderInbox
9olFolderCalendar
10olFolderContacts
13olFolderDrafts
28olFolderToDo

Meeting Status Constants (OlMeetingStatus)

ValueStatus
0olNonMeeting (appointment, no attendees)
1olMeeting (meeting with attendees)
3olMeetingReceived
5olMeetingCanceled

Workflow

Initialization

Always start by creating the COM object:

powershell
$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNameSpace("MAPI")

Get the current user's email

powershell
$currentUser = $namespace.CurrentUser
$currentUserEmail = $namespace.Accounts.Item(1).SmtpAddress
Write-Host "Logged in as: $currentUserEmail"

Email Operations

Send an Email

powershell
$mail = $outlook.CreateItem(0)
$mail.Subject = "Subject here"
$mail.Body = "Plain text body here"
# For HTML body use: $mail.HTMLBody = "<h1>Hello</h1><p>HTML content</p>"
$mail.To = "recipient@example.com"
# $mail.CC = "cc@example.com"
# $mail.BCC = "bcc@example.com"

# Add attachment (optional):
# $mail.Attachments.Add("C:\path\to\file.pdf")

$mail.Send()
Write-Host "Email sent successfully"

Read Inbox Emails

powershell
$inbox = $namespace.GetDefaultFolder(6)
$messages = $inbox.Items
$messages.Sort("[ReceivedTime]", $true)  # Sort newest first

# Get last N emails
$count = [Math]::Min(10, $messages.Count)
for ($i = 1; $i -le $count; $i++) {
    $msg = $messages.Item($i)
    Write-Host "---"
    Write-Host "From: $($msg.SenderEmailAddress)"
    Write-Host "Subject: $($msg.Subject)"
    Write-Host "Received: $($msg.ReceivedTime)"
    Write-Host "Unread: $($msg.UnRead)"
}

Search Emails

Use the Restrict method with DASL or Jet query filters:

powershell
$inbox = $namespace.GetDefaultFolder(6)

# Search by subject (contains)
$filter = "@SQL=""urn:schemas:httpmail:subject"" LIKE '%search term%'"
$results = $inbox.Items.Restrict($filter)

# Search by sender
$filter = "@SQL=""urn:schemas:httpmail:fromemail"" = 'sender@example.com'"
$results = $inbox.Items.Restrict($filter)

# Search by date range
$startDate = (Get-Date).AddDays(-7).ToString("MM/dd/yyyy HH:mm")
$filter = "[ReceivedTime] >= '$startDate'"
$results = $inbox.Items.Restrict($filter)

# Search unread only
$filter = "[UnRead] = True"
$results = $inbox.Items.Restrict($filter)

# Combine filters with AND/OR
$filter = "@SQL=""urn:schemas:httpmail:subject"" LIKE '%project%' AND ""urn:schemas:httpmail:hasattachment"" = 1"
$results = $inbox.Items.Restrict($filter)

foreach ($item in $results) {
    Write-Host "$($item.ReceivedTime) | $($item.SenderEmailAddress) | $($item.Subject)"
}
Write-Host "Found $($results.Count) matching emails"

Reply / Forward

powershell
$inbox = $namespace.GetDefaultFolder(6)
$email = $inbox.Items.GetFirst()

# Reply
$reply = $email.Reply()
$reply.Body = "Reply text`n" + $reply.Body
$reply.Send()

# Reply All
$replyAll = $email.ReplyAll()
$replyAll.Body = "Reply all text`n" + $replyAll.Body
$replyAll.Send()

# Forward
$fwd = $email.Forward()
$fwd.To = "someone@example.com"
$fwd.Body = "FYI`n" + $fwd.Body
$fwd.Send()

Calendar Operations

Create an Appointment (no attendees)

powershell
$appt = $outlook.CreateItem(1)
$appt.Subject = "My Appointment"
$appt.Body = "Description here"
$appt.Start = [DateTime]"2026-03-15 10:00"
$appt.Duration = 60  # minutes
$appt.Location = "Room 101"
$appt.ReminderSet = $true
$appt.ReminderMinutesBeforeStart = 15
$appt.Save()
Write-Host "Appointment created: $($appt.Subject) at $($appt.Start)"

Create a Meeting (with attendees)

powershell
$meeting = $outlook.CreateItem(1)
$meeting.MeetingStatus = 1  # olMeeting
$meeting.Subject = "Team Sync"
$meeting.Body = "Weekly sync meeting"
$meeting.Start = [DateTime]"2026-03-15 14:00"
$meeting.Duration = 30
$meeting.Location = "Conference Room A"

# Add required attendees
$meeting.Recipients.Add("attendee1@example.com")
$meeting.Recipients.Add("attendee2@example.com")

# Add optional attendee
$optionalAttendee = $meeting.Recipients.Add("optional@example.com")
$optionalAttendee.Type = 2  # olOptional (1=Required, 2=Optional, 3=Resource)

$meeting.Recipients.ResolveAll()

$meeting.Send()  # Use .Save() to save without sending invites
Write-Host "Meeting invitation sent: $($meeting.Subject)"

Create a Recurring Meeting

powershell
$meeting = $outlook.CreateItem(1)
$meeting.Subject = "Daily Standup"
$meeting.Start = [DateTime]"2026-03-16 09:00"
$meeting.Duration = 15

$recurrence = $meeting.GetRecurrencePattern()
$recurrence.RecurrenceType = 1  # 0=Daily, 1=Weekly, 2=Monthly, 3=MonthNth, 5=Yearly
$recurrence.Interval = 1
$recurrence.DayOfWeekMask = 62  # Mon-Fri (2+4+8+16+32)
$recurrence.PatternStartDate = [DateTime]"2026-03-16"
$recurrence.PatternEndDate = [DateTime]"2026-06-30"

$meeting.Save()
Write-Host "Recurring meeting created"

List Upcoming Calendar Events

powershell
$calendar = $namespace.GetDefaultFolder(9)
$items = $calendar.Items
$items.Sort("[Start]")
$items.IncludeRecurrences = $true

$startDate = (Get-Date).ToString("MM/dd/yyyy")
$endDate = (Get-Date).AddDays(7).ToString("MM/dd/yyyy")
$filter = "[Start] >= '$startDate' AND [Start] <= '$endDate'"
$upcoming = $items.Restrict($filter)

foreach ($event in $upcoming) {
    Write-Host "$($event.Start) - $($event.End) | $($event.Subject) | $($event.Location)"
}

Find and Modify a Meeting

powershell
$calendar = $namespace.GetDefaultFolder(9)
$filter = "@SQL=""urn:schemas:httpmail:subject"" = 'Team Sync'"
$found = $calendar.Items.Restrict($filter)

if ($found.Count -gt 0) {
    $meeting = $found.GetFirst()
    $meeting.Start = [DateTime]"2026-03-15 15:00"  # Reschedule
    $meeting.Duration = 45
    $meeting.Save()  # or $meeting.Send() to notify attendees
    Write-Host "Meeting updated"
}

Delete/Cancel a Meeting

powershell
$calendar = $namespace.GetDefaultFolder(9)
$filter = "[Subject] = 'Team Sync'"
$found = $calendar.Items.Restrict($filter)

if ($found.Count -gt 0) {
    $meeting = $found.GetFirst()
    $meeting.Delete()
    Write-Host "Meeting deleted"
}

Contact Operations

Create a Contact

powershell
$contact = $outlook.CreateItem(2)
$contact.FullName = "John Doe"
$contact.Email1Address = "john.doe@example.com"
$contact.BusinessTelephoneNumber = "+1-555-0100"
$contact.CompanyName = "Contoso"
$contact.JobTitle = "Engineer"
$contact.Save()

Search Contacts

powershell
$contacts = $namespace.GetDefaultFolder(10)
$filter = "[FullName] = 'John Doe'"
$results = $contacts.Items.Restrict($filter)
foreach ($c in $results) {
    Write-Host "$($c.FullName) - $($c.Email1Address)"
}

Task Operations

Create a Task

powershell
$task = $outlook.CreateItem(3)
$task.Subject = "Review PR #42"
$task.Body = "Review and approve the pull request"
$task.DueDate = (Get-Date).AddDays(2)
$task.Importance = 2  # 0=Low, 1=Normal, 2=High
$task.Save()

Folder Operations

List All Folders

powershell
function List-OutlookFolders($folder, $indent = 0) {
    $prefix = " " * $indent
    Write-Host "$prefix$($folder.Name) ($($folder.Items.Count) items)"
    foreach ($subfolder in $folder.Folders) {
        List-OutlookFolders $subfolder ($indent + 2)
    }
}

$root = $namespace.Folders
foreach ($store in $root) {
    List-OutlookFolders $store
}

Move Email to Folder

powershell
$inbox = $namespace.GetDefaultFolder(6)
$targetFolder = $inbox.Folders.Item("Archive")  # subfolder of Inbox
$email = $inbox.Items.GetFirst()
$email.Move($targetFolder)

Tips and Error Handling

  • Security prompts: Outlook may show security dialogs when accessing certain properties (like .Body of emails from external senders). This is by design.
  • COM cleanup: After heavy COM usage, release objects:
    powershell
    [System.Runtime.InteropServices.Marshal]::ReleaseComObject($outlook) | Out-Null
  • Outlook must be running: The COM object connects to a running Outlook instance or starts one. Ensure Outlook is configured with an account.
  • Date formats: Use the system's date format or explicit [DateTime] casting to avoid locale issues.
  • Large mailboxes: Use .Restrict() filters instead of iterating all items for performance.
  • Error handling pattern:
    powershell
    try {
        $outlook = New-Object -ComObject Outlook.Application
        # ... operations ...
    } catch {
        Write-Error "Outlook COM error: $_"
    }

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Outlook Automation AI skill do?

Control Microsoft Outlook on Windows via COM automation. Use when the user wants to create meetings, send emails, search emails, read inbox, manage calendar events, or interact with Outlook in any way. Triggers on phrases like "create meeting", "send email", "search emails", "check inbox", "calendar", "schedule", "outlook".

Why use Outlook Automation on TypingMind?

Because you install it once and use it with any model. Outlook Automation is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Outlook Automation in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tamirdresher/squad-skills/tree/main/plugins/outlook-automation. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Outlook Automation?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Outlook Automation?

As many as you like. As long as a model supports skills, you can use Outlook Automation with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Outlook Automation AI skill free?

Yes. It is published on GitHub by tamirdresher under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇