# Office-Add-in-samples is Microsoft's gallery of working add-in projects

> The OfficeDev/Office-Add-in-samples repository collects code samples for Office Add-in development on the Microsoft 365 platform, from hello world task panes for each host application, through completed tutorial projects, to Blazor WebAssembly add-ins and single sign-on samples using MSAL.js nested app authentication. The samples directory is the best overview of what the platform can currently do.

**OfficeDev/Office-Add-in-samples** — Code samples for Office Add-in development on the Microsoft 365 platform.

- Repository: https://github.com/OfficeDev/Office-Add-in-samples
- Stars: 1,015 · Forks: 950
- Language: JavaScript
- License: MIT
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/officedev-office-add-in-samples

## A gallery, and how it is meant to be read

The repository description is precise. It is code samples for Office Add-in development on the Microsoft 365 platform, and the readme says they are provided to help you learn, study and build great Office Add-ins.

So the unit of the repository is a sample, and the samples are organised by capability rather than by product. The getting started section says the simplest samples show how to build the simplest Office Add-in with only a manifest, an HTML web page and a logo, and that they help you understand the fundamental parts of an add-in. The readme then points to the quick starts and tutorials on the Microsoft Learn site for further reading.

That is the design in one sentence. The add-in itself is a web application, so the parts that matter are the manifest that describes it to Office, the page that Office displays, and everything the add-in does with the host document through the JavaScript API. A hello world sample that contains only those three things is the clearest possible explanation of what an add-in is.

The implementation language recorded for the repository is JavaScript, the licence is MIT, and the last push was on 2026-10-19, so the gallery is being kept in step with the platform rather than left as an archive of 2020 tutorials.

## Hello world, for every host and both add-in types

The getting started samples are split by the two kinds of add-in Office supports, and each host application gets its own.

The task pane add-ins are the Excel, Outlook, PowerPoint and Word hello world samples, each in its own directory under the hello-world folder.

A task pane is the panel that opens beside the document, and it is the most common shape because it is the one where the add-in can have its own UI while the user keeps working in the document. The four samples are near identical in structure and differ in the host APIs they touch, which is exactly the comparison you want to make when you are learning.

The content add-ins are the Excel and PowerPoint hello world samples. A content add-in is different in kind: it inserts content into the document itself rather than living in a side panel, so it is a different model with a different set of APIs, and the gallery ships both so the distinction is not theoretical.

The readme also points to the quick starts on Microsoft Learn, including the Excel jQuery quick start, and to the tutorials index. The relationship is that the sample in this repository is the completed form of the tutorial on the documentation site, which means the sample is the answer key and the tutorial is the question.

## The completed tutorials are the real curriculum

The tutorial table is the part of the gallery that shows the platform's capabilities most concretely, because each entry lists what the finished add-in actually does.

The Excel tutorial sample is the completed version of the tutorial for creating an Excel task pane add-in with command ribbon buttons, and it shows how to create and sort a table, make a chart, freeze a row, protect a worksheet and display a dialog box.

The Outlook tutorial covers message compose mode, and the add-in collects information from the user, fetches data from an external service, implements a function command, implements a task pane and displays a dialog box.

There are two PowerPoint tutorial samples, one built in Visual Studio and one built with yo office, and they show adding a photo of the day to a slide, adding text, getting slide metadata and navigating between slides.

The Word tutorial is the broadest. It shows how to insert and replace text ranges, paragraphs, images, HTML, tables and content controls, how to format text, and how to manage content in content controls.

And there is a first-run experience tutorial sample, which shows the basics of implementing a first-run experience, with Excel used in the sample but the pattern applicable to other Office applications where Office Web Add-ins are supported.

That last one is a good example of the kind of thing samples are uniquely good for. A first-run experience is a UX pattern with a lot of small decisions in it, and reading a working implementation is faster than reading a description of one.

## Blazor WebAssembly and single sign-on samples

Two sections cover the technology choices that come up most often in questions about Office add-ins.

The Blazor WebAssembly section has three samples, one each for Excel, PowerPoint and Word, and each is described in one line as using .NET Blazor technologies to build the add-in. The point of them is the language, and the point of having all three is that the host APIs differ while the framework does not, so the comparison shows which parts are platform and which parts are Blazor.

The authentication section covers accessing and working with a user's Microsoft Graph data using the Microsoft identity platform.

The single sign-on samples are the ones to read carefully, because single sign-on inside Office has a specific shape. The Excel, PowerPoint and Word sample shows how to use MSAL.js nested app authentication in an Office Add-in to access Microsoft Graph APIs for the signed-in user, displaying the user's name and email and inserting the names of files from the user's OneDrive account into the document.

The Outlook sample does the same for a new message body.

Nested app authentication is the mechanism, and MSAL.js is the library. The reason it is nested is that the add-in runs in a web view inside the Office client, so it inherits the signed-in user from the host application rather than asking the user to sign in again. The samples show the name and email of the signed-in user and read from OneDrive, which is the demonstration that the identity really is the user's and not a token the add-in obtained for itself.

## The Samples directory is the map of the platform

The list of example directories is the most current information in the repository, because it shows what the platform is working on rather than what it did in 2020.

The entries include excel-content-data-visualization, excel-create-worksheet-from-web-site, excel-insert-file, excel-open-in-teams, excel-data-types-explorer, excel-add-in-mail-merge, excel-content-add-in, and excel-copilot-skill.

The shared runtime samples are two of them, excel-shared-runtime-global-state and excel-shared-runtime-scenario.

Then there is the office platform surface: office-add-in-commands, office-contextual-tabs, office-keyboard-shortcuts, office-keytips, office-visibility and office-add-in-save-custom-settings, plus dynamic-dpi and excel-custom-functions-sync, and a VSTO-shared-code-migration directory, which is the one aimed at people arriving from the old desktop add-in model.

Two other top level directories are worth noting. Excel-custom-functions/ sits outside Samples/, and Templates/ suggests there is starting point material as well as worked examples. There is a Samples/README.md as the index, a scripts/ directory, an assets/ directory, and an npm-audit-fix.sh script at the root.

## The automated workflows are the maintenance story

The badges at the top of the readme are the interesting part, because they describe how the gallery is kept usable rather than how it is built.

There is an autorun-npm-audit-fix workflow, with a badge for it, and there is a Dependabot updates workflow. And there is a pages build deployment workflow, which is what publishes the samples to GitHub Pages.

The npm audit fix workflow is the one that tells you the most. A gallery of JavaScript samples accumulates vulnerable transitive dependencies faster than anything else, because each sample pins whatever was current when it was written and nobody comes back to update it. A workflow that opens a fix automatically keeps that from becoming the reason a sample is unusable, and it is a better use of maintainer time than a monthly sweep over forty directories.

The rest of the repository follows the same pattern of a Microsoft sample repository. There is a CODE_OF_CONDUCT.md, a CONTRIBUTING.md, a SECURITY.md, a LICENSE file with the MIT terms, a.github/ directory, and an Office Add-ins community call.ics file, which is a calendar invite for the community call where the add-in samples are discussed and the roadmap is set.

The last push was on 2026-10-19, and the recent release tags look nothing like the samples themselves, which are named with numbers like 264053 and carry the title of the change, for example Integrate an Azure Function with your Excel custom function, from 2020-12-28. The tags are the pull request that added a sample, not a versioned release, which is a reasonable convention for a gallery.

## Conclusion

Adopt the Office Add-in samples as a reference when you are building an add-in for Excel, Word, PowerPoint or Outlook, because each sample is a complete, runnable project for one capability rather than a fragment. Do not treat the repository as a framework or a starting template to fork wholesale, since the samples exist to be read and each one carries its own dependency set. Verify first which host application and add-in type you need against the Samples directory, that the manifest in the sample matches the API version your tenant supports, and that the sample you copy uses the identity flow, SSO with nested app authentication, that your Azure registration is set up for.

## FAQ

### What is the Office-Add-in-samples repository?

It is a collection of code samples for Office Add-in development on the Microsoft 365 platform, provided to help you learn, study and build Office add-ins. The samples cover task pane and content add-ins for Excel, Word, PowerPoint and Outlook, completed tutorials, Blazor WebAssembly add-ins and single sign-on samples.

### What is the smallest Office add-in sample made of?

The getting started samples show how to build the simplest Office Add-in with only a manifest, an HTML web page and a logo, which are the fundamental parts of an add-in. The readme points to the quick starts and tutorials on Microsoft Learn for more.

### What do the completed tutorial samples show?

The Excel one creates and sorts a table, makes a chart, freezes a row, protects a worksheet and displays a dialog box. The Word one inserts and replaces text ranges, paragraphs, images, HTML, tables and content controls, formats text and manages content in content controls.

### How does single sign-on work in the Office add-in samples?

The samples use MSAL.js nested app authentication to access Microsoft Graph APIs for the signed-in user, displaying the user's name and email and inserting OneDrive file names into the document or a new Outlook message, without asking the user to sign in again.

### Which languages and frameworks do the samples use?

Most are JavaScript, and there is a Blazor WebAssembly section with .NET samples for Excel, PowerPoint and Word that use .NET Blazor technologies to build the add-in.

### How is the samples repository kept up to date?

Automated workflows do the work, including an autorun npm audit fix workflow and Dependabot updates, alongside the pages build deployment that publishes the samples. The last push was on 2026-10-19.

## Sources

- [Issues](https://github.com/OfficeDev/Office-Add-in-samples/issues)
- [License: MIT](https://github.com/OfficeDev/Office-Add-in-samples/blob/main/LICENSE)
- [OfficeDev/Office-Add-in-samples on GitHub](https://github.com/OfficeDev/Office-Add-in-samples)
- [README](https://github.com/OfficeDev/Office-Add-in-samples/blob/main/README.md)
- [Releases](https://github.com/OfficeDev/Office-Add-in-samples/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/officedev-office-add-in-samples
