Word · C# walkthrough
A concise policy brief
Turn a short working agreement into a consistent document. The example names the owner and review date, explains who the agreement applies to, and keeps the instructions close to their exceptions.
- Start with
- Working agreements and review ownership
- Generate
- DOCX + PDF

How it works
Set searchable metadata
Populate the built-in title and subject so the file carries context beyond its filename.
Use a small heading hierarchy
Build sections through a local function that adds a heading and paragraph. Word's native heading styles keep the document editable.
Make the actions scannable
Use a bullet list for the steps somebody should follow, then describe the exception and review paths.
The C# source
This is the complete example file used to generate the download. The walkthrough runner creates the output directory and produces the additional previews.
using System.IO;
using OfficeIMO.Word;
namespace OfficeIMO.Examples.Showcase.Workflows;
/// <summary>Creates a short policy brief with reusable heading structure and bullet lists.</summary>
internal static class PolicyBrief {
internal static void Create(string folder) {
using WordDocument document = WordDocument.Create(Path.Combine(folder, "example.docx"));
document.Settings.FontFamily = "Carlito";
document.Settings.FontSize = 11;
document.BuiltinDocumentProperties.Title = "Shared workspace guide";
document.BuiltinDocumentProperties.Subject = "Working agreements";
document.AddParagraph("Shared workspace guide").Style = WordParagraphStyles.Heading1;
document.AddParagraph("Version 1.0 | Owner: Workplace team | Review: March 2027");
document.AddParagraph("A concise working agreement for reserving shared desks and meeting spaces.");
Section("Who this applies to", "Everyone using the shared office, including visitors and project teams.");
Section("Reserve the space", "Book the desk or room you need. Include setup time and release unused bookings so another team can use the space.");
document.AddParagraph("Leave it ready for the next person").Style = WordParagraphStyles.Heading2;
WordList actions = document.AddList(WordListStyle.Bulleted);
actions.AddItem("Remove personal items and dispose of waste.");
actions.AddItem("Return adapters and equipment to the labelled storage area.");
actions.AddItem("Report damaged equipment to the Workplace team.");
Section("Exceptions", "Contact the Workplace team for accessible equipment, recurring project space, or a visitor group.");
Section("Questions and review", "The Workplace team records feedback and reviews the agreement every six months.");
foreach (WordParagraph paragraph in document.Paragraphs) {
paragraph.FontFamily = "Carlito";
paragraph.FontSize = 11;
paragraph.LineSpacingAfterPoints = 7;
if (paragraph.Style == WordParagraphStyles.Heading1) {
paragraph.FontSize = 26;
paragraph.Bold = true;
paragraph.LineSpacingAfterPoints = 12;
} else if (paragraph.Style == WordParagraphStyles.Heading2) {
paragraph.FontSize = 15;
paragraph.Bold = true;
paragraph.LineSpacingBeforePoints = 12;
paragraph.LineSpacingAfterPoints = 6;
}
}
document.Save();
void Section(string heading, string body) {
document.AddParagraph(heading).Style = WordParagraphStyles.Heading2;
document.AddParagraph(body);
}
}
}
Open the C# source fileRun it from the source checkout
Clone the OfficeIMO repository and run this command from its root with the .NET 10 SDK. The first run restores the example project's dependencies.
dotnet run --project OfficeIMO.Examples -f net10.0 -- --showcase-workflows --showcase-example word-policy-briefThe files are written to OfficeIMO.Examples/bin/Debug/net10.0/Documents/Workflows/word-policy-brief/. To use the example in your application, start with the Word guide and its package setup.
Downloads and scope
What the preview shows
The linked C# example generates this file. The runner reopens and validates the DOCX, exports a PDF, and the preview renders that PDF.
What to keep in mind
This is a formatting and authoring example with fictional workplace content. It does not supply an organization's approved policy or enforce compliance.