We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34ef63d commit 3e73763Copy full SHA for 3e73763
src/taskpane/word.ts
@@ -16,15 +16,13 @@ export async function run() {
16
/**
17
* Insert your Word code here
18
*/
19
- const range = context.document.getSelection();
20
21
- // Read the range text
22
- range.load("text");
+ // insert a paragraph at the end of the document.
+ const paragraph = context.document.body.insertParagraph("Hello World", Word.InsertLocation.end);
23
24
- // Update font color
25
- range.font.color = "red";
+ // change the paragraph color to blue.
+ paragraph.font.color = "blue";
26
27
await context.sync();
28
- console.log(`The selected text was ${range.text}.`);
29
});
30
-}
+}
0 commit comments