Spire.Agent.Office
11.6.2
dotnet add package Spire.Agent.Office --version 11.6.2
NuGet\Install-Package Spire.Agent.Office -Version 11.6.2
<PackageReference Include="Spire.Agent.Office" Version="11.6.2" />
<PackageVersion Include="Spire.Agent.Office" Version="11.6.2" />
<PackageReference Include="Spire.Agent.Office" />
paket add Spire.Agent.Office --version 11.6.2
#r "nuget: Spire.Agent.Office, 11.6.2"
#:package Spire.Agent.Office@11.6.2
#addin nuget:?package=Spire.Agent.Office&version=11.6.2
#tool nuget:?package=Spire.Agent.Office&version=11.6.2
Embed Office AI Agents Directly Into Your Software
Product Page | Tutorials | Demo | Examples | Forum | Blog | Customized Demo | Temporary License
Transforms natural language into fixed document processing workflows. Our enterprise-level component libraries enable smooth API integration and support Word, Excel, presentations, PDF and more file formats.
About Spire.Agent.Office
Spire.Agent.Office empowers users to create, edit, analyze, and automate spreadsheets, Word documents, presentation slides, and PDFs via natural language. Build your AI Agent with Spire.Agent.Office today.
Why Enterprises Choose Spire.Agent.Office
AI-Native Experience Interact with Excel via natural language, eliminating complicated development workflows.
Enterprise Reliability Built on mature, verified spreadsheet processing technology optimized for production use cases.
Easy Integration Embed Excel AI functions into your current applications and services with ease.
Flexible AI Model Support Fully compatible with state-of-the-art AI models and enterprise AI infrastructures.
Scalable Processing Efficiently process single requests and large-volume automated workloads alike.
Accelerated Productivity Slash document processing time by 60% and maintain over 95% accuracy in code generation.
Supported Platforms & File Formats
Supported Development Platforms
- .NET 10.0
- Cross-platform: Windows, macOS, Linux, Docker container deployment
Supported Document Formats
- Excel: .xls, .xlsx, .xlsm, .xlsb
- Word: .doc, .docx, .docm
- Presentation: .ppt, .pptx, .pptm
- PDF: Standard PDF, text-based PDF (encrypted PDF with password supported)
| Parameter | Description |
|---|---|
| SpireToken | Authorization key for activating AI features, obtained from official website |
AI Agent Example for Excel Processing
//XLS
static AIResult ExecuteDemoXls(string instruction, string inputPath, string savePath, string key, string[] attachmentPaths)
{
AIOptions options = new AIOptions();
options.SpireToken = key;
using (Workbook workbook = new Workbook())
{
// Load the document if the input path exists and the file is accessible
if (!string.IsNullOrEmpty(inputPath) && File.Exists(inputPath))
{
workbook.LoadFromFile(inputPath);
}
// Otherwise, use an empty Workbook (adjust behavior as needed for your business logic)
AIDocumentProcessor processor = workbook.AI(options);
return processor.ExecuteInstruction(workbook, instruction, savePath, attachmentPaths);
}
}
AI Agent Example for Word Processing
//doc
static AIResult ExecuteDemoWord(string instruction, string inputPath, string savePath, string key, string[] attachmentPaths)
{
AIOptions options = new AIOptions();
options.SpireToken = key;
using (Document doc = new Document())
{
// Load the document if the input path exists and the file is accessible
if (!string.IsNullOrEmpty(inputPath) && File.Exists(inputPath))
{
doc.LoadFromFile(inputPath);
}
// Otherwise, use an empty Document (adjust behavior as needed for your business logic)
AIDocumentProcessor processor = doc.AI(options);
return processor.ExecuteInstruction(doc, instruction, savePath, attachmentPaths);
}
}
AI Agent Example for PDF Processing
//PDF
static AIResult ExecuteDemoPDF(string instruction, string inputPath, string savePath, string key, string[] attachmentPaths)
{
AIOptions options = new AIOptions();
options.SpireToken = key;
using (PdfDocument pdf = new PdfDocument())
{
// Load the document if the input path exists and the file is accessible
if (!string.IsNullOrEmpty(inputPath) && File.Exists(inputPath))
{
pdf.LoadFromFile(inputPath);
}
// Otherwise, use an empty PdfDocument (adjust behavior as needed for your business logic)
AIDocumentProcessor processor = pdf.AI(options);
return processor.ExecuteInstruction(pdf, instruction, savePath, attachmentPaths);
}
}
AI Agent Example for Presentation slides Processing
//PPT generation
static PPTGenerationResult GeneratPPT(string input, string instruction, string savePath, string key)
{
AIOptions options = new AIOptions();
options.SpireToken = key;
using (Presentation ppt = new Presentation())
{
AIDocumentProcessor processor = ppt.AI(options);
return processor.GeneratePresentation(input, instruction, savePath);
}
}
//Based on existing PPT processing
static AIResult ExecuteDemoPPT(string inputPath, string instruction, string savePath, string key, string[] attachmentPaths)
{
AIOptions options = new AIOptions();
options.SpireToken = key;
using (Presentation ppt = new Presentation())
{
// Load the document if the input path exists and the file is accessible
if (!string.IsNullOrEmpty(inputPath) && File.Exists(inputPath))
{
ppt.LoadFromFile(inputPath);
}
// Otherwise, use an empty Presentation (adjust behavior as needed for your business logic)
AIDocumentProcessor processor = ppt.AI(options);
return processor.ExecuteInstruction(ppt, instruction, savePath, attachmentPaths);
}
}
Frequenly Asked Questions/ FAQ
Token Invalid Error
Check whether the SpireToken is copied completely without extra spaces.
Temporary token expires after a certain period, re-apply a new license.
File Loading Failed
Confirm the file path is correct and the file is not occupied by other software.
Encrypted files need to input password before loading.
AI Task Timeout
Large-size documents or complex logic will take longer; split batch tasks to improve stability.
Low Code Generation Accuracy
Optimize natural language instructions with clear, detailed requirements.
Attach reference documents to provide more data context for AI.
Product Page | Tutorials | Demo | Examples | Forum | Blog | Customized Demo | Temporary License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- coverlet.collector (>= 6.0.2)
- Dapper (>= 2.1.35)
- FluentAssertions (>= 7.1.0)
- HarfBuzzSharp (>= 8.3.0.1)
- Microsoft.CodeAnalysis.CSharp (>= 4.5.0)
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 4.5.0)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.5.0)
- Microsoft.CodeAnalysis.Workspaces.MSBuild (>= 4.5.0)
- Microsoft.Data.Sqlite (>= 8.0.0)
- Microsoft.DotNet.Interactive (>= 1.0.0-beta.23403.1)
- Microsoft.DotNet.Interactive.CSharp (>= 1.0.0-beta.23403.1)
- Microsoft.Extensions.Caching.Memory (>= 10.0.3)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.8)
- Microsoft.Extensions.Configuration.Json (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection (>= 10.0.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Hosting (>= 10.0.3)
- Microsoft.Extensions.Http (>= 10.0.3)
- Microsoft.Extensions.Http.Polly (>= 10.0.3)
- Microsoft.Extensions.Logging (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging.Console (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
- Microsoft.ML.OnnxRuntime (>= 1.17.3)
- Microsoft.NET.Test.Sdk (>= 17.12.0)
- Microsoft.Win32.Registry (>= 5.0.0)
- Polly (>= 8.5.0)
- Polly.Extensions.Http (>= 3.0.0)
- Serilog (>= 4.2.0)
- Serilog.Extensions.Logging (>= 10.0.0)
- Serilog.Sinks.File (>= 7.0.0)
- SkiaSharp (>= 3.116.1)
- Spire.Docfor.NETStandard (>= 14.6.13)
- Spire.PDFfor.NETStandard (>= 12.6.9)
- Spire.Presentationfor.NETStandard (>= 11.6.11)
- Spire.XLSfor.NETStandard (>= 16.6.3)
- System.Drawing.Common (>= 10.0.0)
- System.Text.Encoding.CodePages (>= 10.0.0)
- System.Text.Json (>= 10.0.0)
- xunit (>= 2.9.2)
- xunit.runner.visualstudio (>= 2.8.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.