Logo di Outlook Automation

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".

Panoramica

Pubblicato datamirdresher
Repositorysquad-skills
Nome della skilloutlook-automation
Stelle
44
Fork
9
File inclusi
2
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 2

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da tamirdresher su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Outlook Automation in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/tamirdresher/squad-skills/tree/main/plugins/outlook-automation
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Outlook Automation in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Outlook Automation non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Outlook Automation non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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".

Perché usare Outlook Automation su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Outlook Automation è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Outlook Automation in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/tamirdresher/squad-skills/tree/main/plugins/outlook-automation. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Outlook Automation?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Outlook Automation?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Outlook Automation: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Outlook Automation è gratuita?

Sì. È pubblicata su GitHub da tamirdresher con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇