PptMcp.ComInterop
1.0.0
dotnet add package PptMcp.ComInterop --version 1.0.0
NuGet\Install-Package PptMcp.ComInterop -Version 1.0.0
<PackageReference Include="PptMcp.ComInterop" Version="1.0.0" />
<PackageVersion Include="PptMcp.ComInterop" Version="1.0.0" />
<PackageReference Include="PptMcp.ComInterop" />
paket add PptMcp.ComInterop --version 1.0.0
#r "nuget: PptMcp.ComInterop, 1.0.0"
#:package PptMcp.ComInterop@1.0.0
#addin nuget:?package=PptMcp.ComInterop&version=1.0.0
#tool nuget:?package=PptMcp.ComInterop&version=1.0.0
PptMcp.ComInterop
Low-level COM interop utilities for PowerPoint automation.
Overview
This library provides PowerPoint-specific COM object lifecycle management and OLE message filtering. It's the foundation layer for PptMcp projects, handling STA threading, session management, and batch operations specifically for PowerPoint COM automation.
Features
- STA Threading Management - Ensures proper single-threaded apartment model for PowerPoint COM objects
- COM Object Lifecycle - Automatic COM object cleanup and garbage collection
- OLE Message Filtering - Handles busy/rejected COM calls with retry logic using Polly
- PowerPoint Session Management - Manages PowerPoint.Application lifecycle safely
- Batch Operations - Efficient handling of multiple PowerPoint operations in a single session
Usage Example
using PptMcp.ComInterop;
// Use PptSession for safe PowerPoint automation
await using var session = await PptSession.BeginAsync("path/to/presentation.pptx");
await using var batch = await session.BeginBatchAsync();
await batch.ExecuteAsync<int>(async (ctx, ct) =>
{
// Access PowerPoint presentation through ctx.Book
dynamic slides = ctx.Book.Slides;
dynamic slide = slides.Item(1);
// Perform PowerPoint operations
slide.Name = "UpdatedSlide";
return 0;
});
await batch.Save();
Key Classes
- PptSession - Manages PowerPoint.Application lifecycle and presentation operations
- PptBatch - Groups multiple operations for efficient execution
- ComUtilities - Helper methods for COM object cleanup and safe property access
- OleMessageFilter - Implements retry logic for busy PowerPoint instances
Requirements
- Windows OS
- .NET 10.0 or later
- Microsoft PowerPoint 2016+ installed
Platform Support
- ✅ Windows x64
- ✅ Windows ARM64
- ❌ Linux (PowerPoint COM not available)
- ❌ macOS (PowerPoint COM not available)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Extensions.Configuration (>= 9.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.ObjectPool (>= 9.0.4)
- Microsoft.Extensions.Resilience (>= 9.1.0)
- Microsoft.Office.Interop.PowerPoint (>= 15.0.4420.1018)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PptMcp.ComInterop:
| Package | Downloads |
|---|---|
|
PptMcp.Core
Core library for PowerPoint automation operations via COM interop. Provides high-level commands for slides, shapes, text, charts, and more. Shared by PptMcp.McpServer and PptMcp.CLI. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 85 | 3/20/2026 |
See https://github.com/trsdn/mcp-server-ppt/releases for release notes