Logo: Outlook Automation

Outlook Automation

Communautéit
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".

Iwwersiicht

Editeurtamirdresher
Repositorysquad-skills
Skill-Nummoutlook-automation
Stären
44
Forks
9
Matgeliwwert Dateien
2
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    tamirdresher huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Outlook Automation an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/tamirdresher/squad-skills/tree/main/plugins/outlook-automation
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Outlook Automation an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Outlook Automation automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Outlook Automation net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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: $_"
    }

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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".

Firwat Outlook Automation op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Outlook Automation besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Outlook Automation an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/tamirdresher/squad-skills/tree/main/plugins/outlook-automation an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Outlook Automation benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Outlook Automation benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Outlook Automation domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Outlook Automation gratis?

Jo. tamirdresher huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇