### Development Setup Script Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markup.VSCode/README.md Installs npm dependencies, compiles the extension, and sets up the development environment for the OfficeIMO Markup VS Code extension. ```powershell npm install npm run compile .\scripts\dev-install.ps1 -Insiders -Force ``` -------------------------------- ### Full Document Assembly Example Source: https://github.com/evotecit/officeimo/blob/master/Website/content/blog/creating-word-documents.md A complete example demonstrating document creation, paragraph addition, table population, and saving. ```csharp using OfficeIMO.Word; using var doc = WordDocument.Create("Report.docx"); var title = doc.AddParagraph("Quarterly Sales Report"); title.Bold = true; title.FontSize = 24; doc.AddParagraph("Generated automatically by OfficeIMO."); var table = doc.AddTable(2, 2); table.Rows[0].Cells[0].Paragraphs[0].Text = "Metric"; table.Rows[0].Cells[1].Paragraphs[0].Text = "Value"; table.Rows[1].Cells[0].Paragraphs[0].Text = "Total Revenue"; table.Rows[1].Cells[1].Paragraphs[0].Text = "$2.7M"; doc.Save(); Console.WriteLine("Report.docx created successfully."); ``` -------------------------------- ### Export Word Document to Google Docs Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Word.GoogleDocs/README.md Quick start example demonstrating how to create a Word document, add content, configure a Google Workspace session with retry options, and export the document to Google Docs. It also shows how to access the report notices. ```csharp using OfficeIMO.GoogleWorkspace; using OfficeIMO.Word; using OfficeIMO.Word.GoogleDocs; using var document = WordDocument.Create("proposal.docx"); document.AddParagraph("Quarterly business review").SetStyle(WordParagraphStyles.Heading1); document.AddParagraph("Highlights and next steps."); var session = new GoogleWorkspaceSession( new StaticAccessTokenCredentialSource(""), new GoogleWorkspaceSessionOptions { DefaultFolderId = "documents-folder-id", MaxRetryCount = 5, RetryBaseDelay = TimeSpan.FromMilliseconds(250), RetryMaxDelay = TimeSpan.FromSeconds(10), DiagnosticSink = entry => Console.WriteLine($"{entry.Severity}: {entry.Feature} [{entry.FailureKind}] - {entry.Message}"), }); var options = new GoogleDocsSaveOptions { Title = "Quarterly business review", }; var plan = document.CreateGoogleDocsTranslationPlan(options); foreach (var notice in plan.Report.Notices) { Console.WriteLine($"{notice.Severity}: {notice.Feature} - {notice.Message}"); } var result = await document.ExportToGoogleDocsAsync(session, options); Console.WriteLine(result.DocumentId); Console.WriteLine(result.WebViewLink); ``` -------------------------------- ### Quick Start: Parse and Export Markup to PowerPoint Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markup.PowerPoint/README.md This example demonstrates parsing a markup string and exporting it as a PowerPoint file. Ensure you have the necessary using directives. ```csharp using OfficeIMO.Markup; using OfficeIMO.Markup.PowerPoint; var result = OfficeMarkupParser.Parse(""" --- profile: presentation title: Quarterly Review --- # Quarterly Review @slide { layout: title-and-content transition: fade } - Revenue grew - Churn improved ::notes Open with the top-line result. """); new OfficeMarkupPowerPointExporter().Export(result.Document, new OfficeMarkupPowerPointExportOptions { OutputPath = "quarterly-review.pptx" }); ``` -------------------------------- ### Run PowerPoint Layout Strategy Example Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Command to run the PowerPoint layout strategy example using .NET CLI. ```bash dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --powerpoint-layout-strategy ``` -------------------------------- ### Quick Start: Exporting a Workbook from Markup Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markup.Excel/README.md This example demonstrates how to parse a workbook-defined markup and export it as an Excel file. Ensure you have the necessary using statements for OfficeIMO.Markup and OfficeIMO.Markup.Excel. ```csharp using OfficeIMO.Markup; using OfficeIMO.Markup.Excel; var result = OfficeMarkupParser.Parse(""" --- profile: workbook title: Revenue Workbook --- @sheet { name: Revenue } ::range address=A1 Product,2024,2025 A,100,120 B,80,92 ::table name=\"RevenueTable\" range=A1:C3 header=true ::formula cell=D2 =C2-B2 """); new OfficeMarkupExcelExporter().Export(result.Document, new OfficeMarkupExcelExportOptions { OutputPath = "revenue.xlsx" }); ``` -------------------------------- ### Generate Full First-Party PDF Example Set Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Examples/README.md Run this command to generate the complete set of first-party PDF examples. This provides a comprehensive overview of OfficeIMO's PDF capabilities. ```bash dotnet run --project OfficeIMO.Examples -- --pdf ``` -------------------------------- ### Run Designer PowerPoint Example Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Command to run the designer PowerPoint example using .NET CLI. ```bash dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --designer-powerpoint ``` -------------------------------- ### Install OfficeIMO.Markup.Word Package Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markup.Word/README.md Install the OfficeIMO.Markup.Word package using the .NET CLI. ```powershell dotnet add package OfficeIMO.Markup.Word ``` -------------------------------- ### Run PowerPoint Deck Plan Example Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/powerpoint/designer/index.md Execute the .NET command to run the PowerPoint deck plan example. This generates a deck based on specified project and framework. ```powershell dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --powerpoint-deck-plan ``` -------------------------------- ### Configure Guides and Grid Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Enables snapping to a grid, sets grid spacing, clears existing guides, and adds vertical, column, and edge guides to the presentation. ```csharp ppt.SnapToGrid = true; ppt.SetGridSpacingCm(0.5, 0.5); ppt.ClearGuides(); ppt.AddGuideCm(PowerPointGuideOrientation.Vertical, 2.0); ppt.AddColumnGuidesCm(columnCount: 3, marginCm: 1.0, gutterCm: 0.5, includeOuterEdges: true); ``` -------------------------------- ### Initialize Google Workspace Session with Static Token Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.GoogleWorkspace/README.md Quick start example for creating a GoogleWorkspaceSession using a static access token. Configure application name, default drive and folder IDs, and retry policies. ```csharp using OfficeIMO.GoogleWorkspace; var session = new GoogleWorkspaceSession( new StaticAccessTokenCredentialSource(""), new GoogleWorkspaceSessionOptions { ApplicationName = "OfficeIMO Samples", DefaultDriveId = "shared-drive-id", DefaultFolderId = "reports-folder-id", MaxRetryCount = 5, RetryBaseDelay = TimeSpan.FromMilliseconds(250), RetryMaxDelay = TimeSpan.FromSeconds(10), RequestTimeout = TimeSpan.FromSeconds(120), }); ``` -------------------------------- ### Verify .NET Package Installation Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/getting-started/installation/index.md After installing a .NET package, build your project to verify the installation. ```bash dotnet build ``` -------------------------------- ### Generate Designer Examples Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Generates specific PowerPoint examples for website screenshots, demonstrating explainable design recommendations and semantic deck-plan scoring. ```powershell dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --powerpoint-design-brief ``` ```powershell dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --powerpoint-deck-plan ``` -------------------------------- ### Run PowerPoint Design Brief Example Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/powerpoint/designer/index.md Execute the .NET command to run the PowerPoint design brief example. This generates a deck based on specified project and framework. ```powershell dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --powerpoint-design-brief ``` -------------------------------- ### Install OfficeIMO.Word.Html package Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/converters/word-html/index.md Use the dotnet CLI to add the required package to your project. ```bash dotnet add package OfficeIMO.Word.Html ``` -------------------------------- ### Run Full PowerPoint Examples Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Executes the complete set of PowerPoint examples without requiring PowerPoint to be open, validating every generated deck. ```powershell dotnet run --project OfficeIMO.Examples/OfficeIMO.Examples.csproj -f net10.0 -- --powerpoint ``` -------------------------------- ### Generate CONTRIBUTING Guide Scaffold Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/markdown/index.md Generate a standard CONTRIBUTING guide scaffold using the `ContributingScaffold` class for a specified project. ```csharp // Generate a CONTRIBUTING guide var contributing = ContributingScaffold.Contributing("MyProject"); ``` -------------------------------- ### Quick Setup for Excel Document Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Excel/README.md Configure execution mode, parallelism, and save options for efficient Excel document processing. This setup is suitable for report exports where worksheet saves are deferred. ```csharp using var doc = ExcelDocument.Create(path); // Prefer all cores for compute; keep writes safe doc.Execution.Mode = ExecutionMode.Automatic; doc.Execution.MaxDegreeOfParallelism = Environment.ProcessorCount; doc.Execution.SaveWorksheetAfterAutoFit = false; // report-export mode: save once at the document boundary doc.Execution.OnDecision = (op, n, m) => Console.WriteLine($"[Exec] {op}: {n} → {m}"); // AutoFit with parallel compute var s = doc.AddWorkSheet("Data"); // ... fill sheet ... s.AutoFitColumns(); ``` -------------------------------- ### Install OfficeIMO.Reader Package Source: https://github.com/evotecit/officeimo/blob/master/Website/content/blog/reading-documents-with-reader.md Use the dotnet CLI to add the OfficeIMO.Reader package to your project. ```bash dotnet add package OfficeIMO.Reader ``` -------------------------------- ### Export Visio Showcase Previews with Desktop Integration Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Examples/README.md When Microsoft Visio desktop is installed, add this flag to export first-page .png and .svg previews, plus a browseable index.html. This requires Visio to be installed on the machine. ```bash dotnet run --project OfficeIMO.Examples --framework net8.0 -- --visio-export ``` -------------------------------- ### Install OfficeIMO.PowerPoint Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Adds the OfficeIMO.PowerPoint NuGet package to your .NET project. ```powershell dotnet add package OfficeIMO.PowerPoint ``` -------------------------------- ### PowerShell Loop Example Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Examples/Converters/Html/Content/all.html A simple PowerShell script demonstrating a loop and output. ```powershell Write-Host "Hello from PowerShell" for ($i=0; $i -lt 5; $i++) { Write-Output $i } ``` -------------------------------- ### Get Help for a PSWriteOffice Cmdlet Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/pswriteoffice/index.md Fetches detailed help information for a specific PSWriteOffice cmdlet, including its parameters and examples. ```powershell Get-Help New-OfficeWord -Full ``` ```powershell Get-Help Add-OfficeWordParagraph -Examples ``` -------------------------------- ### Run OfficeIMO Examples with Visio Showcase Source: https://github.com/evotecit/officeimo/blob/master/Docs/officeimo.visio.visual-audit-2026-05-31.md Executes the OfficeIMO.Examples application to generate a Visio showcase and preview. ```bash OfficeIMO.Examples\bin\Release\net8.0\OfficeIMO.Examples.exe --visio-showcase --visio-preview ``` -------------------------------- ### Excel Named Ranges Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Excel/README.md Demonstrates setting and getting workbook-global and sheet-local named ranges. Includes examples of validation modes (Sanitize and Strict) and handling potential exceptions. ```csharp // Workbook-global doc.SetNamedRange("GlobalArea", "'Data'!A1:B10"); // Sheet-local var data = doc["Data"]; data.SetNamedRange("LocalStart", "A1"); // Reading a local name returns an unqualified A1 for convenience Assert.Equal("$A$1", data.GetNamedRange("LocalStart")); // Reading a global name returns a sheet-qualified A1 Assert.Equal("'Data'!$A$1:$B$10", doc.GetNamedRange("GlobalArea")); // Validation modes: Sanitize (default) vs. Strict // Name and range are both checked. Sanitize will coerce; Strict throws. doc.SetNamedRange("123 Bad Name", "'Data'!A1:B10000000", validationMode: NameValidationMode.Sanitize); // becomes _123_Bad_Name and clamps rows Assert.Equal("'Data'!$A$1:$B$1048576", doc.GetNamedRange("_123_Bad_Name")); Assert.Throws(() => doc.SetNamedRange("BadStrict", "'Data'!A1:B10000000", validationMode: NameValidationMode.Strict)); ``` -------------------------------- ### Build OfficeIMO Examples Project Source: https://github.com/evotecit/officeimo/blob/master/Docs/officeimo.visio.visual-audit-2026-05-31.md Builds the OfficeIMO.Examples project in Release configuration for .NET 8.0 without restoring packages, using a shared compilation setting. ```bash dotnet build OfficeIMO.Examples\OfficeIMO.Examples.csproj -c Release --framework net8.0 --no-restore -nodeReuse:false -p:UseSharedCompilation=false ``` -------------------------------- ### Quick Start: Export Excel to Google Sheets Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Excel.GoogleSheets/README.md Demonstrates the basic setup for exporting an Excel workbook to Google Sheets. Includes creating a workbook, adding data, configuring the Google Workspace session with retry options, and performing the export. ```csharp using OfficeIMO.Excel; using OfficeIMO.Excel.GoogleSheets; using OfficeIMO.GoogleWorkspace; using var workbook = ExcelDocument.Create("report.xlsx"); var sheet = workbook.AddWorkSheet("Summary"); sheet.CellValue(1, 1, "Quarter"); sheet.CellValue(1, 2, "Revenue"); sheet.CellValue(2, 1, "Q1"); sheet.CellValue(2, 2, 125000); var session = new GoogleWorkspaceSession( new StaticAccessTokenCredentialSource(""), new GoogleWorkspaceSessionOptions { DefaultFolderId = "reports-folder-id", MaxRetryCount = 5, RetryBaseDelay = TimeSpan.FromMilliseconds(250), RetryMaxDelay = TimeSpan.FromSeconds(10), DiagnosticSink = entry => Console.WriteLine($"{entry.Severity}: {entry.Feature} [{entry.FailureKind}] - {entry.Message}"), }); var options = new GoogleSheetsSaveOptions { Title = "Quarterly revenue", }; var plan = workbook.CreateGoogleSheetsTranslationPlan(options); foreach (var notice in plan.Report.Notices) { Console.WriteLine($"{notice.Severity}: {notice.Feature} - {notice.Message}"); } var result = await workbook.ExportToGoogleSheetsAsync(session, options); Console.WriteLine(result.SpreadsheetId); Console.WriteLine(result.WebViewLink); ``` -------------------------------- ### Use Designer and Add Slides Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Demonstrates how to use the designer to choose a recommended deck and add slides based on a plan. It also shows how to describe slides for a live preview. ```C# var recommendedDeck = ppt.UseDesigner(brief, plan, alternativeCount: 3); // choose the recommended design var livePreview = recommendedDeck.DescribeSlides(plan); // seed preview accounts for slides already composed in this deck recommendedDeck.AddSlides(plan); // validates errors before rendering and keeps warnings inspectable ``` -------------------------------- ### Initialize Markdown Renderer Presets Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.MarkdownRenderer/README.md Demonstrates the initialization of various strict, portable, and IntelligenceX-specific presets. ```csharp var strict = MarkdownRendererPresets.CreateStrict(); var strictPortable = MarkdownRendererPresets.CreateStrictPortable(); var minimal = MarkdownRendererPresets.CreateStrictMinimal(); var minimalPortable = MarkdownRendererPresets.CreateStrictMinimalPortable(); var relaxed = MarkdownRendererPresets.CreateRelaxed(); var ixTranscript = MarkdownRendererPresets.CreateIntelligenceXTranscript(); var ixTranscriptPortable = MarkdownRendererPresets.CreateIntelligenceXTranscriptPortable(); var ixTranscriptMinimal = MarkdownRendererPresets.CreateIntelligenceXTranscriptMinimal(); var ixTranscriptMinimalPortable = MarkdownRendererPresets.CreateIntelligenceXTranscriptMinimalPortable(); var ixTranscriptDesktopShell = MarkdownRendererPresets.CreateIntelligenceXTranscriptDesktopShell(); var ixTranscriptRelaxed = MarkdownRendererPresets.CreateIntelligenceXTranscriptRelaxed(); ``` -------------------------------- ### Parse Markdown to Typed Document Model Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markdown/README.md This example shows how to parse a Markdown file into a typed document model using MarkdownReader.Parse(). It demonstrates iterating through headings to get their level, text, and anchor, listing all descendant block types, and retrieving front matter values. ```csharp var parsed = MarkdownReader.Parse(File.ReadAllText("README.md")); foreach (var heading in parsed.GetHeadingInfos()) { Console.WriteLine($"{heading.Level}: {heading.Text} -> {heading.Anchor}"); } foreach (var block in parsed.DescendantsAndSelf()) { Console.WriteLine(block.GetType().Name); } if (parsed.HasDocumentHeader && parsed.TryGetFrontMatterValue("title", out var title)) { Console.WriteLine("Title: " + title); } ``` -------------------------------- ### Install OfficeIMO.Visio Package Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Visio/README.md Use the dotnet CLI to add the OfficeIMO.Visio package to your project. ```powershell dotnet add package OfficeIMO.Visio ``` -------------------------------- ### WPF Window Setup with MarkdownView Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.MarkdownRenderer.Wpf/README.md Demonstrates how to declare and configure the MarkdownView control within a WPF Window. Ensure the correct namespace and assembly are referenced. ```xml ``` -------------------------------- ### Install PSWriteOffice for All Users Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/getting-started/installation/index.md Install the PSWriteOffice module for all users. This requires administrator privileges. ```powershell Install-Module -Name PSWriteOffice -Scope AllUsers ``` -------------------------------- ### Initialize Reader, Writer, and HTML Profiles Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markdown/README.md Demonstrates the creation of various reader and writer profiles alongside HTML fragment configuration. ```csharp var officeReader = MarkdownReaderOptions.CreateOfficeIMOProfile(); var commonMarkReader = MarkdownReaderOptions.CreateCommonMarkProfile(); var gfmReader = MarkdownReaderOptions.CreateGitHubFlavoredMarkdownProfile(); var portableReader = MarkdownReaderOptions.CreatePortableProfile(); var officeWriter = MarkdownWriteOptions.CreateOfficeIMOProfile(); var portableWriter = MarkdownWriteOptions.CreatePortableProfile(); var portableHtml = new HtmlOptions { Kind = HtmlKind.Fragment }; MarkdownBlockRenderBuiltInExtensions.AddPortableHtmlFallbacks(portableHtml); ``` -------------------------------- ### Install OfficeIMO.Word.Markdown Package Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/converters/word-markdown/index.md Install the OfficeIMO.Word.Markdown package using the .NET CLI. This package has several dependencies. ```bash dotnet add package OfficeIMO.Word.Markdown ``` -------------------------------- ### Install PSWriteOffice Module Source: https://github.com/evotecit/officeimo/blob/master/Website/content/blog/powershell-meets-office.md Install the module from the PowerShell Gallery to begin using document automation cmdlets. ```powershell Install-Module -Name PSWriteOffice -Scope CurrentUser ``` -------------------------------- ### Render Code Examples Template Source: https://github.com/evotecit/officeimo/blob/master/Website/themes/officeimo/partials/sections/code-examples.html Template logic for iterating through code example tabs and rendering their content. ```handlebars {{ if data.code_examples && data.code_examples.tabs }} {{ if data.sections && data.sections.code_examples && data.sections.code_examples.label }} {{ data.sections.code_examples.label }} {{ end }} {{ data.code_examples.title ?? "Code Examples" }} -------------------------------------------------- {{ if data.code_examples.description }} {{ data.code_examples.description }} {{ end }} {{ for tab in data.code_examples.tabs }} {{ tab.label }} {{ end }} {{ for tab in data.code_examples.tabs }} {{ tab.code }} {{ end }} {{ end }} ``` -------------------------------- ### Create and Populate a Table Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Word/README.md Demonstrates creating a table with specified dimensions, setting header text, marking the header row, applying a style, and merging cells. ```csharp var t = doc.AddTable(3, 3); t[1,1].Text = "Header 1"; t[1,2].Text = "Header 2"; t[1,3].Text = "Header 3"; t.HeaderRow = true; t.Style = WordTableStyle.TableGrid; t.MergeCells(2,1, 2,3); // row 2, col 1..3 ``` -------------------------------- ### Deprecated BODY Element Example Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Examples/Templates/SampleFileHTML.html An example demonstrating the use of deprecated presentational attributes for the BODY element. ```APIDOC ## Deprecated BODY Example ### Description This HTML fragment illustrates the use of the deprecated attributes for setting background and text colors. ### HTML ```html A study of population dynamics _... document body... ``` ``` -------------------------------- ### Create PowerPoint with Designer Alternatives Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Demonstrates creating a PowerPoint presentation and using designer alternatives from a brand color and client name. It shows how to pick a specific design alternative and use it to compose the deck. ```csharp using OfficeIMO.PowerPoint; using var ppt = PowerPointPresentation.Create("designer-demo.pptx"); ppt.SlideSize.SetPreset(PowerPointSlideSizePreset.Screen16x9); var alternatives = PowerPointDeckDesign.CreateAlternativesFromBrand("#008C95", "client-demo", name: "Client Theme", eyebrow: "Client Group", footerLeft: "CLIENT", footerRight: "Service deck"); var design = alternatives[1]; // pick the stable Editorial creative direction for this deck var deck = ppt.UseDesigner(design); ``` -------------------------------- ### Install OfficeIMO.MarkdownRenderer packages Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.MarkdownRenderer/README.md Use these commands to add the core renderer or the IntelligenceX plugin pack to your .NET project. ```powershell dotnet add package OfficeIMO.MarkdownRenderer ``` ```powershell dotnet add package OfficeIMO.MarkdownRenderer.IntelligenceX ``` -------------------------------- ### Install and Use PSWriteOffice Source: https://github.com/evotecit/officeimo/blob/master/Website/content/products/pswriteoffice.md Install the module and use its DSL-based cmdlets to generate Word documents, Excel workbooks, and PowerPoint presentations. ```powershell # Install the module Install-Module PSWriteOffice -Force # Create a Word document New-OfficeWord -Path ".\Report.docx" { Add-OfficeWordSection { Add-OfficeWordParagraph -Style Heading1 -Text "Monthly Report" Add-OfficeWordParagraph -Text "Generated on $(Get-Date -Format 'MMMM yyyy')" $data = @( [pscustomobject]@{ Region = "North"; Revenue = 42000; Target = 40000 } [pscustomobject]@{ Region = "South"; Revenue = 38000; Target = 35000 } [pscustomobject]@{ Region = "East"; Revenue = 29000; Target = 30000 } [pscustomobject]@{ Region = "West"; Revenue = 51000; Target = 45000 } ) Add-OfficeWordTable -InputObject $data -Style GridTable4Accent1 Add-OfficeWordParagraph { Add-OfficeWordText -Text "All regions met or exceeded targets except East." } } } # Create an Excel workbook New-OfficeExcel -Path ".\Metrics.xlsx" { Add-OfficeExcelSheet -Name "Summary" { Set-OfficeExcelCell -Address "A1" -Value "Metric" Set-OfficeExcelCell -Address "B1" -Value "Value" Set-OfficeExcelCell -Address "C1" -Value "Status" Set-OfficeExcelCell -Address "A2" -Value "Uptime" Set-OfficeExcelCell -Address "B2" -Value "99.97%" Set-OfficeExcelCell -Address "C2" -Value "OK" Set-OfficeExcelCell -Address "A3" -Value "Response Time" Set-OfficeExcelCell -Address "B3" -Value "42ms" Set-OfficeExcelCell -Address "C3" -Value "OK" } Add-OfficeExcelSheet -Name "Details" { Set-OfficeExcelCell -Address "A1" -Value "Timestamp" Set-OfficeExcelCell -Address "B1" -Value "Endpoint" Set-OfficeExcelCell -Address "C1" -Value "Latency" $rowIndex = 2 1..10 | ForEach-Object { Set-OfficeExcelCell -Row $rowIndex -Column 1 -Value ((Get-Date).AddMinutes(-$_)) Set-OfficeExcelCell -Row $rowIndex -Column 2 -Value "/api/data" Set-OfficeExcelCell -Row $rowIndex -Column 3 -Value (Get-Random -Minimum 20 -Maximum 80) $rowIndex++ } } } # Create a PowerPoint presentation $ppt = New-OfficePowerPoint -FilePath ".\Status.pptx" $slide = Add-OfficePowerPointSlide -Presentation $ppt Add-OfficePowerPointTextBox -Slide $slide -Text "Weekly Status" -X 80 -Y 60 -Width 520 -Height 50 Add-OfficePowerPointBullets -Slide $slide -Bullets @( "Shipped v3.2 to production", "Resolved 14 customer tickets", "Completed security audit" ) -X 80 -Y 150 -Width 520 -Height 220 $ppt | Save-OfficePowerPoint ``` -------------------------------- ### Install OfficeIMO.CSV via Package Manager Console Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/getting-started/installation/index.md Use the Package Manager Console in Visual Studio to install the OfficeIMO.CSV package. ```powershell Install-Package OfficeIMO.CSV ``` -------------------------------- ### Run Comparison Suite Source: https://github.com/evotecit/officeimo/blob/master/Docs/officeimo.excel.benchmark-notes.md Execute the comparison suite for a broad proof run. Specify release mode, target framework, project path, and output directory. Configure row set size, warmup iterations, and measurement iterations. ```powershell dotnet run -c Release --framework net8.0 --project .\OfficeIMO.Excel.Benchmarks\OfficeIMO.Excel.Benchmarks.csproj -- comparison-suite --out-dir .\Docs\benchmarks\comparison-current --row-set 2500,25000 --warmup 1 --iterations 3 ``` -------------------------------- ### Install OfficeIMO.Markdown via Package Manager Console Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/getting-started/installation/index.md Use the Package Manager Console in Visual Studio to install the OfficeIMO.Markdown package. ```powershell Install-Package OfficeIMO.Markdown ``` -------------------------------- ### Install OfficeIMO.Markup.PowerPoint Package Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markup.PowerPoint/README.md Use this command to add the necessary package to your .NET project. ```powershell dotnet add package OfficeIMO.Markup.PowerPoint ``` -------------------------------- ### Install OfficeIMO.Excel via Package Manager Console Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/getting-started/installation/index.md Use the Package Manager Console in Visual Studio to install the OfficeIMO.Excel package. ```powershell Install-Package OfficeIMO.Excel ``` -------------------------------- ### Install OfficeIMO.Word via Package Manager Console Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/getting-started/installation/index.md Use the Package Manager Console in Visual Studio to install the OfficeIMO.Word package. ```powershell Install-Package OfficeIMO.Word ``` -------------------------------- ### Install Insiders Build Script Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Markup.VSCode/README.md Installs the Insiders build of the OfficeIMO Markup extension, typically used for testing pre-release versions. ```powershell .\scripts\install-insiders.ps1 -Force ``` -------------------------------- ### Get Style Definition from WordCharacterStyles Source: https://github.com/evotecit/officeimo/blob/master/Docs/officeimo.word.wordcharacterstyle.md Retrieves the Style object for a given WordCharacterStyles enum value. Use this to get the underlying style definition. ```csharp public static Style GetStyleDefinition(WordCharacterStyles style) ``` -------------------------------- ### Generate a complete report Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/pswriteoffice/word/index.md Full example demonstrating document creation, data processing, sectioning, and saving. ```powershell Import-Module PSWriteOffice $doc = New-OfficeWord -Path "C:\Reports\ServerReport.docx" -PassThru $doc | Add-OfficeWordParagraph -Text "Server Health Report" -Style Heading1 -Alignment Center $date = Get-Date -Format "MMMM dd, yyyy" $doc | Add-OfficeWordParagraph { Add-OfficeWordText -Text "Generated: $date" -Italic } $disks = Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DriveType=3" $diskRows = $disks | ForEach-Object { [pscustomobject]@{ Drive = $_.DeviceID 'Size GB' = [math]::Round($_.Size / 1GB, 1) 'Free GB' = [math]::Round($_.FreeSpace / 1GB, 1) 'Pct Free' = [math]::Round(($_.FreeSpace / $_.Size) * 100, 1) } } $doc | Add-OfficeWordSection { Add-OfficeWordParagraph -Text "Disk Usage" -Style Heading1 Add-OfficeWordTable -InputObject $diskRows -Style "GridTable4Accent1" } $doc | Save-OfficeWord Close-OfficeWord -Document $doc Write-Host "Report saved to C:\Reports\ServerReport.docx" ``` -------------------------------- ### Configure Custom Numbered List Start Value Source: https://github.com/evotecit/officeimo/blob/master/Docs/custom-lists.md Customize the starting number for a specific level in a custom list using `WordListLevel` and `SetStartNumberingValue`. ```csharp var numbered = document.AddCustomList(); var level = new WordListLevel(WordListLevelKind.Decimal) .SetStartNumberingValue(3); numbered.Numbering.AddLevel(level); numbered.AddItem("Starts at three"); ``` -------------------------------- ### Configure IntelligenceX desktop shell Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.MarkdownRenderer/README.md Initialize a desktop shell renderer with support for Mermaid, charts, and network visuals. ```csharp using OfficeIMO.MarkdownRenderer.IntelligenceX; var options = IntelligenceXMarkdownRenderer.CreateTranscriptDesktopShell(); ``` -------------------------------- ### Install OfficeIMO.Word Package Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Word/README.md Use the dotnet CLI to add the OfficeIMO.Word package to your project. ```powershell dotnet add package OfficeIMO.Word ``` -------------------------------- ### HTML ADDRESS Element Example Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Examples/Templates/SampleFileHTML.html This example shows how to use the ADDRESS element to provide contact information for a document, including author names and links. ```html
Dave Raggett, Arnaud Le Hors, contact persons for the W3C HTML Activity
$Date: 2018/03/20 02:36:52 $
``` -------------------------------- ### Create and Configure a Pivot Table Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Excel/README.md Demonstrates creating a pivot table with specified row, column, and filter fields, including data aggregation, formatting, and layout options. Also shows adding a pivot chart from the pivot table. ```csharp // Pivot table and pivot-source chart metadata sheet.Pivot("A1:C100") .Rows("Region") .Columns("Product") .Filters("Channel") .Sum("Sales", "Total Sales", "$#,##0") .PercentOfTotal("Sales", "% of Total", "0.0%") .Style("PivotStyleMedium9") .Layout(ExcelPivotLayout.Tabular) .GrandTotals(rows: true, columns: true) .At("F2", "SalesPivot"); sheet.AddPivotTable( sourceRange: "A1:C100", destinationCell: "F2", name: "SalesPivot", rowFields: new[] { "Region" }, dataFields: new[] { new ExcelPivotDataField("Sales", DataConsolidateFunctionValues.Sum, "Total Sales", numberFormat: "$"#,##0") }, fieldOptions: new[] { new ExcelPivotFieldOptions("Region", sortType: FieldSortValues.Ascending, defaultSubtotal: false, hiddenItems: new[] { "Legacy" }), new ExcelPivotFieldOptions("Product", selectedItem: "Standard") }, pageFields: new[] { "Product" }, rowHeaderCaption: "Region", grandTotalCaption: "Total"); sheet.AddPivotChartFromRange("SalesPivot", "A1:C100", row: 12, column: 1, type: ExcelChartType.ColumnClustered, title: "Sales Pivot"); ``` -------------------------------- ### Install PSWriteOffice Module Source: https://github.com/evotecit/officeimo/blob/master/Website/content/docs/pswriteoffice/index.md Installs the PSWriteOffice module from the PowerShell Gallery. Use the -Scope CurrentUser for the current user or -Scope AllUsers with Administrator privileges for all users. ```powershell Install-Module -Name PSWriteOffice -Scope CurrentUser ``` ```powershell Install-Module -Name PSWriteOffice -Scope AllUsers ``` -------------------------------- ### Create PowerPoint with Deck Plan Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Demonstrates creating a PowerPoint presentation using a deck plan, which allows callers to describe the story while the designer chooses slide compositions. It shows adding sections, case studies, processes, and custom details. ```csharp // A deck plan lets callers describe the story while the designer chooses the slide compositions. var plan = new PowerPointDeckPlan() .AddSection("Case Study", "Project portfolio", "cover") .AddCaseStudy("Example client", new[] { new PowerPointCaseStudySection("Client", "A concise customer story."), new PowerPointCaseStudySection("Challenge", "Many details needed structure."), new PowerPointCaseStudySection("Solution", "Separate story, evidence, and outcome."), new PowerPointCaseStudySection("Result", "Keep the output editable and readable.") }, seed: "case-study") .AddProcess("How we work", "Transparent phases reduce risk", new[] { new PowerPointProcessStep("Analysis", "Understand the environment and constraints."), new PowerPointProcessStep("Discovery", "Review configuration and dependencies."), new PowerPointProcessStep("Delivery", "Implement changes in controlled stages.") }, seed: "process", configure: options => { options.Variant = PowerPointProcessLayoutVariant.Rail; options.ConnectorStyle = PowerPointProcessConnectorStyle.SegmentArrows; }) .AddCustom("Custom detail", composer => { composer.AddTitle("Custom detail", "Use raw composition when a planned slide needs something special."); var layout = composer.UsePreset(PowerPointCompositionPreset.Auto); composer.AddVisualFrame(layout.Visual); composer.AddMetricStrip(new[] { new PowerPointMetric("2", "modes") }, layout.Metrics); }, seed: "custom-detail"); var plannedSlides = plan.DescribeSlides(); // kind, title, seed, and content count var planDiagnostics = plan.ValidateSlides(); // density, clipping, and bounds issues before rendering var renderPreview = brief.DescribeDeckPlan(plan, alternativeIndex: 1); // variants, layout reasons, fonts, and seeds var planChoices = brief.DescribeDeckPlanAlternatives(plan, 3); // includes content-fit score and reasons var recommendedPlan = brief.RecommendDeckPlanAlternative(plan, 3); // strongest content-fit choice first ``` -------------------------------- ### Create Client Design Alternatives Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.PowerPoint/README.md Example of creating custom design alternatives for a client theme, specifying colors, directions, and branding elements. ```C# var clientDirections = new[] { new PowerPointDesignDirection("Board Brief", PowerPointDesignMood.Corporate, PowerPointSlideDensity.Relaxed, PowerPointVisualStyle.Soft, "Georgia", "Aptos", showDirectionMotif: false), new PowerPointDesignDirection("Field Ops", PowerPointDesignMood.Energetic, PowerPointSlideDensity.Compact, PowerPointVisualStyle.Geometric, "Poppins", "Segoe UI") }; var clientAlternatives = PowerPointDeckDesign.CreateAlternativesFromBrand("#008C95", "client-demo", clientDirections, name: "Client Theme", footerLeft: "CLIENT"); ``` -------------------------------- ### Generate Rich PDF Showcase Source: https://github.com/evotecit/officeimo/blob/master/OfficeIMO.Examples/README.md Run this command to generate a richer set of PDF examples, including statements, dashboards, and manipulation samples. This is useful for advanced PDF feature exploration. ```bash dotnet run --project OfficeIMO.Examples -- --pdf-showcase ```