Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .config/samples-config-v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,25 @@
"ref": "main",
"dir": "samples/graph-rsc-helper/nodeJs"
}
},
{
"id": "hello-world-office-add-in",
"shortId": "helloworld-office-wxpo",
"onboardDate": "2024-12-06",
"title": "Hello World Office add-in",
"shortDescription": "A hello world project that contains Office add-in capability",
"fullDescription": "Office add-ins are integrations built by third parties into Office by using our web-based platform. Now you have the ability to create a single unit of distribution for all your Office applications by using the same manifest format and schema.",
"types": [
],
"tags": [
"Office Add-in",
"Outlook Add-in"
],
"time": "5min to run",
"configuration": "Ready for debug",
"thumbnailPath": "assets/thumbnail.png",
"gifPath": "assets/thumbnail.png",
"suggested": false
}
]
}
8 changes: 8 additions & 0 deletions hello-world-office-addin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [
"office-addins"
],
"extends": [
"plugin:office-addins/recommended"
]
}
33 changes: 33 additions & 0 deletions hello-world-office-addin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# TeamsFx files
env/.env.*.user
env/.env.local
appPackage/build

# Dependency directories
node_modules

# Azure Functions artifacts
bin
obj
appsettings.json

# ignore local.settings.json if it contains your own credentials
# local.settings.json

# misc
.DS_Store
.deployment
.env

# build
/dist

# Azurite emulator
_storage_emulator

# Local data
.localConfigs
.notification.localstore.json

# production
/build
5 changes: 5 additions & 0 deletions hello-world-office-addin/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"TeamsDevApp.ms-teams-vscode-extension"
]
}
45 changes: 45 additions & 0 deletions hello-world-office-addin/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Word Desktop (Edge Chromium)",
"type": "msedge",
"request": "attach",
"port": 9229,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: Word Desktop",
"postDebugTask": "Stop Debug"
},
{
"name": "Excel Desktop (Edge Chromium)",
"type": "msedge",
"request": "attach",
"port": 9229,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: Excel Desktop",
"postDebugTask": "Stop Debug"
},
{
"name": "PowerPoint Desktop (Edge Chromium)",
"type": "msedge",
"request": "attach",
"port": 9229,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: PowerPoint Desktop",
"postDebugTask": "Stop Debug"
},
{
"name": "Outlook Desktop (Edge Chromium)",
"type": "msedge",
"request": "attach",
"port": 9229,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: Outlook Desktop",
"postDebugTask": "Stop Debug"
}
]
}
8 changes: 8 additions & 0 deletions hello-world-office-addin/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript"
]
}

146 changes: 146 additions & 0 deletions hello-world-office-addin/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build (Development)",
"type": "npm",
"script": "build:dev",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"dependsOn": [
"Install"
]
},
{
"label": "Build (Production)",
"type": "npm",
"script": "build",
"group": "build",
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"dependsOn": [
"Install"
]
},
{
"label": "Debug: Excel Desktop",
"type": "npm",
"script": "start:desktop:excel",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": [],
"dependsOn": [
"Install"
]
},
{
"label": "Debug: Outlook Desktop",
"type": "npm",
"script": "start:desktop:outlook",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": [],
"dependsOn": [
"Install"
]
},
{
"label": "Debug: PowerPoint Desktop",
"type": "npm",
"script": "start:desktop:powerpoint",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": [],
"dependsOn": [
"Install"
]
},
{
"label": "Debug: Word Desktop",
"type": "npm",
"script": "start:desktop:word",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": [],
"dependsOn": [
"Install"
]
},
{
"label": "Dev Server",
"type": "npm",
"script": "dev-server",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Install",
"type": "npm",
"script": "install",
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": []
},
{
"label": "Lint: Check for problems",
"type": "npm",
"script": "lint",
"problemMatcher": [
"$eslint-stylish"
]
},
{
"label": "Lint: Fix all auto-fixable problems",
"type": "npm",
"script": "lint:fix",
"problemMatcher": [
"$eslint-stylish"
]
},
{
"label": "Stop Debug",
"type": "npm",
"script": "stop",
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": []
},
{
"label": "Watch",
"type": "npm",
"script": "watch",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
}
]
}
75 changes: 75 additions & 0 deletions hello-world-office-addin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
page_type: sample
languages:
- typescript
products:
- office
name: Hello World Office add-in
urlFragment: officedev-teamsfx-samples-hello-world-office-add-in
description: A hello world project that contains Office add-in capability.
extensions:
createdDate: "2024-12-06"
---
# Getting Started with Hello World Office Add-in Sample

Office add-ins are integrations built by third parties into Office by using our web-based platform.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Now you have the ability to create a single unit of distribution for all your Office applications by using the same manifest format and schema, based on the current JSON-formatted MetaOS manifest.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the unified app manifest, you can create a single unit of distribution for all your Microsoft 365 extensions by using the same manifest format and schema.


Currently unified manifest of Office add-in is in public preview, so it does not support deploy and publish.

## This sample illustrates

- How to create an Office add-ins with a unified manifest that works on Word, Excel, Powerpoint, and Outlook.

> [!NOTE]
> The unified app manifest for Word, Excel, and PowerPoint is in preview. Visit [this link](aka.ms/officeversions) to check the required Office Versions. Also, publishing a unified add-in for Word, Excel, PowerPoint is not supported currently.

## Prerequisites to use this sample

* Download and install [Visual Studio Code](https://visualstudio.microsoft.com/downloads/).
* [Teams Toolkit Visual Studio Code Extension version](https://aka.ms/teams-toolkit) 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teams-toolkit-cli)
* Node.js (the latest LTS version). Visit the [Node.js site](https://nodejs.org/) to download and install the right version for your operating system. To verify if you've already installed these tools, run the commands node -v and npm -v in your terminal.
* Microsoft Office connected to a Microsoft 365 subscription. You might qualify for a Microsoft 365 E5 developer subscription through the [Microsoft 365 Developer Program](https://developer.microsoft.com/microsoft-365/dev-program), see [FAQ](https://learn.microsoft.com/office/developer-program/microsoft-365-developer-program-faq#who-qualifies-for-a-microsoft-365-e5-developer-subscription-) for details. Alternatively, you can [sign up for a 1-month free trial](https://www.microsoft.com/microsoft-365/try?rtc=1) or [purchase a Microsoft 365 plan](https://www.microsoft.com/microsoft-365/buy/compare-all-microsoft-365-products).

## Minimal path to awesome

### Debug Office add-in

- Please note that the same M365 account should be used both in Teams Toolkit and Office Applications (Word, Excel, Powerpoint, Outlook).
- From Visual Studio Code only: use the `Run and Debug Activity Panel` in Visual Studio Code, select `Debug in Excel Desktop (Edge Chromium)`, and click the `Run and Debug` green arrow button. Please run VSCode as administrator if localhost loopback for Microsoft Edge Webview hasn't been enabled. Once enbaled, administrator priviledge is no longer required.

![Visual Studio Code debug configuration for Office](./assets/launch.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these 3 pngs can display. Should change the path here


Once the Office app is open, you can select the ribbon command to show the add-in task pane. The snapshot shows Excel as an example, and the other Office applications share the same behavior.
![Excel add-in show taskpane](./assets/excel-ribbon.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here


The taskpane opens and you can check the sideloaded add-in.
![Excel add-in task pane opened](./assets/thumbnail.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here



### Edit the manifest

You can find the app manifest in `./appPackage` folder. The folder contains one manifest file:

- `manifest.json`: Manifest file for Office add-in running locally.

You may add any extra properties or permissions you require to this file. See the [schema reference](https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema) for more information.


### Validate manifest file

To check that your manifest file is valid:

- From Visual Studio Code: open the command palette and select: `Teams: Validate Application` and select `Validate using manifest schema`.
- From Teams Toolkit CLI: run command `teamsapp validate` in your project directory.

## Version History

|Date| Author| Comments|
|---|---|---|
|Dec 06, 2024 | hermanwen | Init sample |

## Feedback

We really appreciate your feedback! If you encounter any issue or error, please report issues to us following the [Supporting Guide](https://github.com/OfficeDev/TeamsFx-Samples/blob/dev/SUPPORT.md). Meanwhile you can make [recording](https://aka.ms/teamsfx-record) of your journey with our product, they really make the product better. Thank you!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading