Coder Social home page Coder Social logo

stkaiser-msft / office-add-in-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from officedev/office-add-in-samples

0.0 0.0 0.0 31.16 MB

Code samples for Office Add-in development on the Microsoft 365 platform.

License: MIT License

JavaScript 95.51% C# 0.04% CSS 3.23% HTML 0.11% SCSS 1.11% ASP.NET 0.01%

office-add-in-samples's Introduction

Office Add-ins code samples

Office Add-ins code samples are provided in this repo to help you learn, study, and built great Office Add-ins!

Getting started

The following samples show how to build the simplest Office Add-in with only a manifest, HTML web page, and a logo. They will help you understand the fundamental parts of an Office Add-in. For additional getting started information, see our quick starts and tutorials.

Auth, Identity and Single Sign-on (SSO)

Name Description
Use SSO in an Outlook Add-in with ASP.NET The sample implements an Outlook add-in that uses Office's SSO feature to give the add-in access to Microsoft Graph data.
Use SSO in an Office Add-in with ASP.NET Implements an Office Add-in that uses the getAccessToken API in Office.js to give the add-in access to Microsoft Graph data. This sample is built on ASP.NET.
Use SSO in an Office Add-in with Node.js Implements an Office Add-in that uses the getAccessToken API in Office.js to give the add-in access to Microsoft Graph data. This sample is built on Node.js.
Use MSAL.js for auth and Microsoft Graph in an Excel add-in Learn how to build a Microsoft Office Add-in, as a single-page application (SPA) with no backend, that connects to Microsoft Graph, and access workbooks stored in OneDrive for Business to update a spreadsheet.
Use MSAL.NET for auth and Microsoft Graph in an Excel add-in Learn how to build a Microsoft Office Add-in that connects to Microsoft Graph, and access workbooks stored in OneDrive for Business to update a spreadsheet.
Use MSAL.NET for auth and Microsoft Graph in an Outlook add-in. Learn how to build a Microsoft Outlook Add-in that connects to Microsoft Graph, and access workbooks stored in OneDrive for Business to compose a new email message.

Outlook

Name Description
Use Outlook event-based activation to encrypt attachments, process meeting request attendees and react to appointment date/time changes Shows how to use event-based activation to encrypt attachments when added by the user. Also shows event handling for recipients changed in a meeting request, and changes to the start or end date or time in a meeting request.
Use Outlook event-based activation to indicate external recipients Uses event-based activation to run an Outlook add-in when the user changes recipients while composing a message. The add-in also uses the appendOnSendAsync API to add a disclaimer.
Use Outlook event-based activation to set the signature Uses event-based activation to run an Outlook add-in when the user creates a new message or appointment.

Excel

Name Description
Open in Teams Creates a new Excel spreadsheet in Microsoft Teams containing data you define.
Insert an external Excel file and populate it with JSON data Insert an existing template from an external Excel file into the currently open Excel file. Then retrieve data from a JSON web service and populate the template for the customer.
Create custom contextual tabs on the ribbon This sample shows how to create a custom contextual tab on the ribbon in the Office UI. The sample creates a table, and when the user moves the focus inside the table, the custom tab is displayed. When the user moves outside the table, the custom tab is hidden.
Use keyboard shortcuts for Office add-in actions Shows how to set up a basic Excel add-in project that utilizes keyboard shortcuts.
Custom function sample using web worker Shows how to use web workers in custom functions to prevent blocking the UI of your Office Add-in.
Use storage techniques to access data from an Office Add-in when offline Demonstrates how you can implement localStorage to enable limited functionality for your Office Add-in when a user experiences lost connection.
Custom function batching pattern Batch multiple calls into a single call to reduce the number of network calls to a remote service.

Word

Name Description
Get, edit, and set OOXML content in a Word document with a Word add-in Shows how to get, edit, and set OOXML content in a Word document.
Load and write Open XML in your Word add-in Shows how to add a variety of rich content types to a Word document using the setSelectedDataAsync method with ooxml coercion type.

Shared JavaScript runtime

Check out these samples if you want to take advantage of the shared runtime for your Office Add-in.

Date Name Description
Share global data with a shared runtime Shows how to set up a basic project that uses the shared runtime to run code for ribbon buttons, task pane, and custom functions in a single browser runtime.
Manage ribbon and task pane UI, and run code on doc open Shows how to create contextual ribbon buttons that are enabled based on the state of your add-in.

Additional samples

Name Description
Use a shared library to migrate your Visual Studio Tools for Office add-in to an Office web add-in Provides a strategy for code reuse when migrating from VSTO Add-ins to Office Add-ins.
Integrate an Azure function with your Excel custom function Learn how to integrate Azure functions with custom functions to move to the cloud or integrate additional services.
Dynamic DPI code samples A collection of samples for handling DPI changes in COM, VSTO, and Office Add-ins.

Learn more

To learn more about Office Add-ins, see the Office Add-ins documentation.

Join the Microsoft 365 Developer Program

Get a free sandbox, tools, and other resources you need to build solutions for the Microsoft 365 platform.

Patterns and Practices community

Office Add-ins PnP is a community driven effort that helps developers extend, build, and provision customizations for the Office platform. The source is maintained on this GitHub repo where anyone can participate. You can provide contributions to the samples, reusable components, and documentation. Office Add-ins PnP is owned and coordinated by Office engineering teams, but the work is done by the community for the community.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

office-add-in-samples's People

Contributors

aafvstam avatar abidrahman-msft avatar alexjerabek avatar alison-mk avatar davidchesnut avatar dependabot[bot] avatar devarvindsa avatar elegault avatar elizabethsamuel-msft avatar eltociear avatar hyoshioka0128 avatar jansenbe avatar jasonnutter avatar john-hart avatar jonathanhuss avatar keyur32 avatar lauragra avatar lindalu-msft avatar nancy-wang avatar nokafor avatar officeglobal avatar paolopia avatar rick-kirkham avatar samantharamon avatar shaofengzhu avatar sharepointing avatar simonjaeger avatar supernova-eng avatar vesajuvonen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.