Skip to content

Commit d108250

Browse files
authored
Merge pull request #110 from akrantz/from-taskpane
Merge from Office-Addin-TaskPane
2 parents 572d073 + e9e5591 commit d108250

File tree

6 files changed

+436
-379
lines changed

6 files changed

+436
-379
lines changed

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@
1515
"preLaunchTask": "Debug: Desktop",
1616
"postDebugTask": "Stop Debug",
1717
"outFiles": [ "${workspaceFolder}/dist/**/*.js" ]
18+
},
19+
{
20+
"name": "Office Online (Chrome)",
21+
"type": "chrome",
22+
"request": "launch",
23+
// To debug your Add-in:
24+
// 1. When prompted, enter the url (share link) to an Office Online document.
25+
// 2. Sideload your Add-in. https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing
26+
"url": "${input:officeOnlineDocumentUrl}",
27+
"webRoot": "${workspaceFolder}",
28+
"preLaunchTask": "Debug: Web"
29+
},
30+
{
31+
"name": "Office Online (Edge)",
32+
"type": "edge",
33+
"request": "launch",
34+
// To debug your Add-in:
35+
// 1. When prompted, enter the url (share link) to an Office Online document.
36+
// 2. Sideload your Add-in. https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing
37+
"url": "${input:officeOnlineDocumentUrl}",
38+
"webRoot": "${workspaceFolder}",
39+
"preLaunchTask": "Debug: Web"
40+
}
41+
],
42+
"inputs": [
43+
{
44+
"id": "officeOnlineDocumentUrl",
45+
"type": "promptString",
46+
"description": "Please enter the url for the Office Online document."
1847
}
1948
]
2049
}

.vscode/tasks.json

Lines changed: 95 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,96 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "2.0.0",
5-
"tasks": [
6-
{
7-
"label": "Build (Development)",
8-
"type": "npm",
9-
"script": "build-dev",
10-
"group": {
11-
"kind": "build",
12-
"isDefault": true
13-
},
14-
"presentation": {
15-
"clear": true,
16-
"panel": "shared",
17-
"showReuseMessage": false
18-
}
19-
},
20-
{
21-
"label": "Build (Production)",
22-
"type": "npm",
23-
"script": "build",
24-
"group": "build",
25-
"presentation": {
26-
"clear": true,
27-
"panel": "shared",
28-
"showReuseMessage": false
29-
}
30-
},
31-
{
32-
"label": "Debug: Desktop",
33-
"type": "npm",
34-
"script": "start",
35-
"presentation": {
36-
"clear": true,
37-
"panel": "shared",
38-
"showReuseMessage": false
39-
},
40-
"problemMatcher": []
41-
},
42-
{
43-
"label": "Dev Server",
44-
"type": "npm",
45-
"script": "dev-server",
46-
"presentation": {
47-
"clear": true,
48-
"panel": "dedicated",
49-
},
50-
"problemMatcher": []
51-
},
52-
{
53-
"label": "Install",
54-
"type": "npm",
55-
"script": "install",
56-
"presentation": {
57-
"clear": true,
58-
"panel": "shared",
59-
"showReuseMessage": false
60-
},
61-
"problemMatcher": []
62-
},
63-
{
64-
"label": "Stop Debug",
65-
"type": "npm",
66-
"script": "stop",
67-
"presentation": {
68-
"clear": true,
69-
"panel": "shared",
70-
"showReuseMessage": false
71-
},
72-
"problemMatcher": []
73-
},
74-
{
75-
"label": "Watch",
76-
"type": "npm",
77-
"script": "watch",
78-
"presentation": {
79-
"clear": true,
80-
"panel": "dedicated",
81-
},
82-
"problemMatcher": []
83-
}
84-
]
85-
}
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Build (Development)",
8+
"type": "npm",
9+
"script": "build-dev",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
},
14+
"presentation": {
15+
"clear": true,
16+
"panel": "shared",
17+
"showReuseMessage": false
18+
}
19+
},
20+
{
21+
"label": "Build (Production)",
22+
"type": "npm",
23+
"script": "build",
24+
"group": "build",
25+
"presentation": {
26+
"clear": true,
27+
"panel": "shared",
28+
"showReuseMessage": false
29+
}
30+
},
31+
{
32+
"label": "Debug: Desktop",
33+
"type": "npm",
34+
"script": "start:desktop",
35+
"presentation": {
36+
"clear": true,
37+
"panel": "shared",
38+
"showReuseMessage": false
39+
},
40+
"problemMatcher": []
41+
},
42+
{
43+
"label": "Debug: Web",
44+
"type": "npm",
45+
"script": "start:web",
46+
"presentation": {
47+
"clear": true,
48+
"panel": "shared",
49+
"showReuseMessage": false
50+
},
51+
"problemMatcher": []
52+
},
53+
{
54+
"label": "Dev Server",
55+
"type": "npm",
56+
"script": "dev-server",
57+
"presentation": {
58+
"clear": true,
59+
"panel": "dedicated"
60+
},
61+
"problemMatcher": []
62+
},
63+
{
64+
"label": "Install",
65+
"type": "npm",
66+
"script": "install",
67+
"presentation": {
68+
"clear": true,
69+
"panel": "shared",
70+
"showReuseMessage": false
71+
},
72+
"problemMatcher": []
73+
},
74+
{
75+
"label": "Stop Debug",
76+
"type": "npm",
77+
"script": "stop",
78+
"presentation": {
79+
"clear": true,
80+
"panel": "shared",
81+
"showReuseMessage": false
82+
},
83+
"problemMatcher": []
84+
},
85+
{
86+
"label": "Watch",
87+
"type": "npm",
88+
"script": "watch",
89+
"presentation": {
90+
"clear": true,
91+
"panel": "dedicated"
92+
},
93+
"problemMatcher": []
94+
}
95+
]
96+
}

Debugging.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Debugging
2+
3+
## Using Visual Studio Code
4+
5+
1. Open the folder in VS Code.
6+
2. Run the `Watch` task using `Terminal`, `Run Task`.
7+
3. Run the `Dev Server` task using `Terminal`, `Run Task`.
8+
9+
10+
### Office Online (Edge - Windows 10 / Chrome - Mac)
11+
1. Switch to the Debug view using `View`, `Debug` or press Ctrl+Shift+D.
12+
2. Choose the desired debug configuration:
13+
* `Office Online (Edge)`
14+
* `Office Online (Chrome)`
15+
3. Start debugging by pressing F5 or the green play icon.
16+
4. When prompted, paste the url for an Office document. You can obtain this by copying the link when sharing a document.
17+
5. Use `Insert`, `Add-ins` to upload the manifest file. [More info](https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing_)
18+
* NOTE: You can also use the browser dev tools to debug.
19+
20+
21+
### Excel / PowerPoint / Word (Windows / Mac)
22+
1. Switch to the Debug view.
23+
2. Choose the desired debug configuration from the list:
24+
* `Excel Desktop`
25+
* `PowerPoint Desktop`
26+
* `Word Desktop`
27+
3. Choose `Start Without Debugging` from the `Debug` menu.
28+
NOTE: The integrated VSCode debugger cannot debug the Office Add-in running in the task pane.
29+
4. To debug, you need to use another debugger:
30+
* `Edge DevTools` (Windows 10)
31+
* `F12 DevTools` (Windows)
32+
* `Visual Studio` (Windows)
33+
* `Safari Inspector` (Mac)
34+
35+
36+
## From the command line
37+
38+
### Watch / Build
39+
* Use `npm run watch` to run build for development, and rebuild automatically when a source file is saved.
40+
* If you would rather build manually, use `npm run build-dev` to build for development.
41+
* To build for production, use `npm run build`.
42+
43+
### Dev Server
44+
* Use `npm run dev-server` to run the dev-server.
45+
46+
### Debugging (Desktop)
47+
* To start debugging, use `npm start desktop -- --app {app}` where `{app}` is `excel`, `powerpoint`, or `word`.
48+
* Be sure to build or run watch beforehand.
49+
* If the dev-server is not already running, it will run the dev-server in a separate window.
50+
* The add-in will be configured for debugging, and a document will be opened which loads the add-in.
51+
* Once you're done debugging, use `npm stop desktop -- --app {app}` so the add-in is no longer configured for debugging.
52+
53+
### Debugging (Office Online)
54+
* To start debugging, use `npm start web`.
55+
* Be sure to build or run watch beforehand.
56+
* If the dev-server is not already running, it will run the dev-server in a separate window.
57+
* Open the desired Office document in the browser.
58+
* Use `Insert`, `Add-ins` to upload the manifest file. [More info](https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing_)
59+
* Use the browser dev tools to debug.

0 commit comments

Comments
 (0)