SpecWorks.OfficeTalkEngine 0.6.0

dotnet add package SpecWorks.OfficeTalkEngine --version 0.6.0
                    
NuGet\Install-Package SpecWorks.OfficeTalkEngine -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpecWorks.OfficeTalkEngine" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpecWorks.OfficeTalkEngine" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="SpecWorks.OfficeTalkEngine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SpecWorks.OfficeTalkEngine --version 0.6.0
                    
#r "nuget: SpecWorks.OfficeTalkEngine, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SpecWorks.OfficeTalkEngine@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SpecWorks.OfficeTalkEngine&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=SpecWorks.OfficeTalkEngine&version=0.6.0
                    
Install as a Cake Tool

OfficeTalkEngine — .NET Library

.NET 9 execution engine for OfficeTalk documents. Resolves addresses, validates semantics, and applies deterministic operations to Microsoft Office documents via the OpenXML SDK.

Quick Start

Parse and Execute

using OfficeTalk.Parsing;
using OfficeTalkEngine.Execution;

var source = """
    OFFICETALK/1.0 Word
    AT paragraph[1]
        SET "Hello, World!"
    """;

// Parse the OfficeTalk source
var parser = new OfficeTalkParser();
var document = parser.Parse(source);

// Execute against a Word document
var executor = new WordExecutor();
executor.Execute(document, "template.docx", "output.docx");

Semantic Validation

using OfficeTalk.Parsing;
using OfficeTalkEngine.Validation;

var parser = new OfficeTalkParser();
var document = parser.Parse(source);

var validator = new SemanticValidator();
var result = validator.Validate(document, "template.docx");

if (!result.IsValid)
{
    foreach (var error in result.Errors)
        Console.WriteLine($"Error: {error}");
}

Address Resolution

using DocumentFormat.OpenXml.Packaging;
using OfficeTalk.Ast;
using OfficeTalkEngine.Addressing;

using var doc = WordprocessingDocument.Open("document.docx", false);
var resolver = new WordAddressResolver(doc);

var address = new Address
{
    Segments = { new AddressSegment { Identifier = "heading", Predicates = { new KeyValuePredicate { Key = "level", Operator = PredicateOperator.Equals, Value = "1" } } } }
};

var elements = resolver.Resolve(address);

Architecture

OfficeTalkEngine implements a three-phase execution pipeline:

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   1. Resolve     │────▶│   2. Validate    │────▶│   3. Execute    │
│                  │     │                  │     │                 │
│ Address segments │     │ Addresses exist? │     │ Snapshot all    │
│ matched against  │     │ Styles valid?    │     │ resolutions,    │
│ document tree    │     │ Search text      │     │ then apply ops  │
│                  │     │ present?         │     │ deterministically│
└─────────────────┘     └──────────────────┘     └─────────────────┘

Phase 1: Address Resolution

IAddressResolver implementations navigate document structure segment by segment, applying predicates (positional, text match, level) to locate target elements.

Phase 2: Semantic Validation

SemanticValidator checks that all addresses resolve, REPLACE search strings exist in target content, and STYLE references map to actual document styles.

Phase 3: Execution

IOfficeTalkExecutor implementations apply operations with snapshot semantics — all addresses are resolved before any mutations occur, ensuring deterministic results.

Project Structure

dotnet/
├── OfficeTalkEngine.slnx
├── src/
│   └── OfficeTalkEngine/
│       ├── Addressing/          # Address resolution against documents
│       │   ├── IAddressResolver.cs
│       │   └── WordAddressResolver.cs
│       ├── Execution/           # Operation execution
│       │   ├── IOfficeTalkExecutor.cs
│       │   ├── WordExecutor.cs        # OpenXML SDK executor
│       │   └── WordComExecutor.cs     # Word COM Interop executor (live editing)
│       └── Validation/          # Semantic validation
│           └── SemanticValidator.cs
└── tests/
    ├── OfficeTalkEngine.Tests/
    │   ├── Addressing/
    │   │   └── WordAddressResolverTests.cs
    │   └── Execution/
    │       └── WordExecutorTests.cs
    └── OfficeTalkEngine.ParityTests/   # COM vs OpenXML parity tests
        └── ParityTests.cs

Supported Operations

Operation Word (OpenXML) Word (COM) Excel PowerPoint
SET
REPLACE / REPLACE ALL
INSERT BEFORE/AFTER
DELETE
APPEND / PREPEND
FORMAT
STYLE
COMMENT
INSERT ROW/COLUMN
SET CELLS / MERGE CELLS
INSERT IMAGE
INSERT TABLE
LINK
INSERT LIST
SET RUNS
INSERT SLIDE / DUPLICATE
ADD/RENAME/DELETE SHEET
INSPECT
PROPERTY

Dependencies

Package Version Purpose
SpecWorks.OfficeTalk (project ref) Core parsing and AST
DocumentFormat.OpenXml 3.1.0 OpenXML SDK for Office documents

License

MIT License

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SpecWorks.OfficeTalkEngine:

Package Downloads
SpecWorks.MarkMyWord

A .NET library for converting CommonMark markdown to Microsoft Word (.docx) documents with syntax highlighting and Mermaid diagrams. Supports headings, paragraphs, emphasis, code blocks with syntax highlighting (JSON, TypeSpec, Bash), Mermaid diagram rendering, links, images, lists, tables, and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 161 3/18/2026
0.5.0 92 3/18/2026
0.4.0 92 3/16/2026
0.3.0 82 3/15/2026
0.2.0 83 3/15/2026
0.1.0 88 3/14/2026