|
17621 | 17621 | console.log("Search term: " + result.searchTerm + " => Count: " + length);
|
17622 | 17622 | });
|
17623 | 17623 | });
|
| 17624 | +'Word.Body#shapes:member': |
| 17625 | + - >- |
| 17626 | + // Link to full sample: |
| 17627 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 17628 | + |
| 17629 | + |
| 17630 | + await Word.run(async (context) => { |
| 17631 | + // Gets text boxes in main document. |
| 17632 | + const shapes: Word.ShapeCollection = context.document.body.shapes; |
| 17633 | + shapes.load(); |
| 17634 | + await context.sync(); |
| 17635 | + |
| 17636 | + if (shapes.items.length > 0) { |
| 17637 | + shapes.items.forEach(function(shape, index) { |
| 17638 | + if (shape.type === Word.ShapeType.textBox) { |
| 17639 | + console.log(`Shape ${index} in the main document has a text box. Properties:`, shape); |
| 17640 | + } |
| 17641 | + }); |
| 17642 | + } else { |
| 17643 | + console.log("No shapes found in main document."); |
| 17644 | + } |
| 17645 | + }); |
17624 | 17646 | 'Word.Body#tables:member':
|
17625 | 17647 | - >-
|
17626 | 17648 | // Link to full sample:
|
|
22108 | 22130 |
|
22109 | 22131 | console.log("Inserted section without an associated page break.");
|
22110 | 22132 | });
|
| 22133 | +'Word.InsertShapeOptions:interface': |
| 22134 | + - >- |
| 22135 | + // Link to full sample: |
| 22136 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 22137 | + |
| 22138 | + |
| 22139 | + await Word.run(async (context) => { |
| 22140 | + // Inserts a text box at the beginning of the selection. |
| 22141 | + const range: Word.Range = context.document.getSelection(); |
| 22142 | + const insertShapeOptions: Word.InsertShapeOptions = { |
| 22143 | + top: 0, |
| 22144 | + left: 0, |
| 22145 | + height: 100, |
| 22146 | + width: 100 |
| 22147 | + }; |
| 22148 | + |
| 22149 | + const newTextBox: Word.Shape = range.insertTextBox("placeholder text", insertShapeOptions); |
| 22150 | + await context.sync(); |
| 22151 | + |
| 22152 | + console.log("Inserted a text box at the beginning of the current selection."); |
| 22153 | + }); |
22111 | 22154 | 'Word.List:class':
|
22112 | 22155 | - >-
|
22113 | 22156 | // Link to full sample:
|
|
23332 | 23375 |
|
23333 | 23376 | await context.sync();
|
23334 | 23377 | });
|
| 23378 | +'Word.Paragraph#insertTextBox:member(1)': |
| 23379 | + - >- |
| 23380 | + // Link to full sample: |
| 23381 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 23382 | + |
| 23383 | + |
| 23384 | + await Word.run(async (context) => { |
| 23385 | + // Inserts a text box at the beginning of the first paragraph in header. |
| 23386 | + const headerFooterBody: Word.Body = context.document.sections.getFirst().getHeader(Word.HeaderFooterType.primary); |
| 23387 | + headerFooterBody.load("paragraphs"); |
| 23388 | + const firstParagraph: Word.Paragraph = headerFooterBody.paragraphs.getFirst(); |
| 23389 | + const insertShapeOptions: Word.InsertShapeOptions = { |
| 23390 | + top: 0, |
| 23391 | + left: 0, |
| 23392 | + height: 100, |
| 23393 | + width: 100 |
| 23394 | + }; |
| 23395 | + const newTextBox: Word.Shape = firstParagraph.insertTextBox("placeholder text", insertShapeOptions); |
| 23396 | + newTextBox.select(); |
| 23397 | + await context.sync(); |
| 23398 | + |
| 23399 | + console.log("Inserted a text box at the beginning of the first paragraph in the header."); |
| 23400 | + }); |
23335 | 23401 | 'Word.Paragraph#select:member(1)':
|
23336 | 23402 | - >-
|
23337 | 23403 | // Link to full sample:
|
|
24173 | 24239 |
|
24174 | 24240 | console.log("Inserted footnote.");
|
24175 | 24241 | });
|
| 24242 | +'Word.Range#insertInlinePictureFromBase64:member(1)': |
| 24243 | + - >- |
| 24244 | + // Link to full sample: |
| 24245 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24246 | + |
| 24247 | + |
| 24248 | + await Word.run(async (context) => { |
| 24249 | + // Inserts a picture at the start of the first text box. |
| 24250 | + const firstShapeWithTextBox: Word.Shape = context.document.body.shapes |
| 24251 | + .getByTypes([Word.ShapeType.textBox]) |
| 24252 | + .getFirst(); |
| 24253 | + firstShapeWithTextBox.load("type/body"); |
| 24254 | + await context.sync(); |
| 24255 | + |
| 24256 | + const startRange: Word.Range = firstShapeWithTextBox.body.getRange(Word.RangeLocation.start); |
| 24257 | + const newPic: Word.InlinePicture = startRange.insertInlinePictureFromBase64( |
| 24258 | + getPictureBase64(), |
| 24259 | + Word.InsertLocation.start |
| 24260 | + ); |
| 24261 | + newPic.load(); |
| 24262 | + await context.sync(); |
| 24263 | + |
| 24264 | + console.log("New inline picture properties:", newPic); |
| 24265 | + }); |
| 24266 | + - >- |
| 24267 | + // Link to full sample: |
| 24268 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24269 | + |
| 24270 | + |
| 24271 | + // Returns Base64-encoded image data for a sample picture. |
| 24272 | + |
| 24273 | + const pictureBase64 = |
| 24274 | + |
| 24275 | + "iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAABblBMVEX+7tEYMFlyg5v8zHXVgof///+hrL77qRnIWmBEWXq6MDgAF0/i1b//8dP+79QKJ1MAIFL8yWpugZz/+O/VzLwzTXR+jaP/z3PHzdjNaWvuxrLFT1n8znmMj5fFTFP25OHlsa2wqqJGW3z7pgCbqsH936oAJlWnssRzdoLTd1HTfINbY3a7tar90IxJVG0AH1ecmJH//90gN14AFU/nxInHVFL80YQAD03qv3LUrm7cwJLWjoLenpPRdXTQgoj15sz+57/7szr93KPbiWjUvZj95LnwzLmMX3L8wmz7rib8xnP8vVz91JT8ukvTz8i8vsORkJKvsLIAD1YwPViWnKZVYHbKuqHjwo3ur2/Pa2O+OTvHVETfj1tybm9qdYlsYlnkmmC0DSPirpvAq4bj5uuono7tu5vgpannnX3ksbSKg5bv0tTclJNFSlyZgpPqwsW4go2giWdbWV+3mmuWgp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3gm52BpMh3c2NPZ6FPhy2YZ9pzmYfBN5IfRGe4x9Nz84EPJL69B4whyL2iEF2Q39Wpnv4h+97RNt7gOMmVIZTh3aaDW5N2k9zjb1QqSL+/QLZmYeBApVlmy9HGeD8wU1MsotBDjT+vShafb/ADXT2XNygxSKiL8A+Ep1uwMLqgh890SlBC7ncasDErqt7eVmkVQ70L2sBddc11J8EaeRGWtNKTfVvpAnqmT3gfsJfG6ZbKEujGTunC6tz1tQ93g2G/qUtub/CJS0LR3WQKo/WysWqZE/reG5Uo4qZLNh+aXNlcYQS6B/7VhvS0Vqd/nZZchrHIx0aK7q5dxNThoiDX5r3raF0nKqzHKtEyf1JDgD1d1+m7A8Asrqk47VyR29o3n9nbtd1im/CzMMLR1u/SUdAb/ar5aa7By0QV+HuTBVMXtl8GGGzezraxXXMQ3+96bGOru6bAnNf7D608EUBgNXWKGW0nJ8BsOCtY4or1Ise5f+FKCBa2HtqBUwujWK0LqbBXMfThqVFO56CbgUNtAulwa0uYK2wkHM9WtiOecHkqRcj7UEAqH+ZwkVq5fS0ctzRcPxSNhtzC5yUc5NO03pFABQWRFc/w5jWC7oSpgr4TJoDLB0JdCfdBfH7VSbh0UPbSqnj5XvxK2aXP4P485IkSZIkSZIkSZIkSZIkSZIkSZIk8Tv/B3bBREdOWYS3AAAAAElFTkSuQmCC"; |
| 24276 | + |
| 24277 | + return pictureBase64; |
| 24278 | +'Word.Range#insertTextBox:member(1)': |
| 24279 | + - >- |
| 24280 | + // Link to full sample: |
| 24281 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24282 | + |
| 24283 | + |
| 24284 | + await Word.run(async (context) => { |
| 24285 | + // Inserts a text box at the beginning of the selection. |
| 24286 | + const range: Word.Range = context.document.getSelection(); |
| 24287 | + const insertShapeOptions: Word.InsertShapeOptions = { |
| 24288 | + top: 0, |
| 24289 | + left: 0, |
| 24290 | + height: 100, |
| 24291 | + width: 100 |
| 24292 | + }; |
| 24293 | + |
| 24294 | + const newTextBox: Word.Shape = range.insertTextBox("placeholder text", insertShapeOptions); |
| 24295 | + await context.sync(); |
| 24296 | + |
| 24297 | + console.log("Inserted a text box at the beginning of the current selection."); |
| 24298 | + }); |
24176 | 24299 | 'Word.Range#footnotes:member':
|
24177 | 24300 | - >-
|
24178 | 24301 | // Link to full sample:
|
@@ -24587,6 +24710,147 @@
|
24587 | 24710 | console.log("Updated shading.");
|
24588 | 24711 | }
|
24589 | 24712 | });
|
| 24713 | +'Word.Shape:class': |
| 24714 | + - >- |
| 24715 | + // Link to full sample: |
| 24716 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24717 | + |
| 24718 | + |
| 24719 | + await Word.run(async (context) => { |
| 24720 | + // Sets the properties of the first text box. |
| 24721 | + const firstShapeWithTextBox: Word.Shape = context.document.body.shapes |
| 24722 | + .getByTypes([Word.ShapeType.textBox]) |
| 24723 | + .getFirst(); |
| 24724 | + firstShapeWithTextBox.top = 115; |
| 24725 | + firstShapeWithTextBox.left = 0; |
| 24726 | + firstShapeWithTextBox.width = 50; |
| 24727 | + firstShapeWithTextBox.height = 50; |
| 24728 | + await context.sync(); |
| 24729 | + |
| 24730 | + console.log("The first text box's properties were updated:", firstShapeWithTextBox); |
| 24731 | + }); |
| 24732 | +'Word.Shape#delete:member(1)': |
| 24733 | + - >- |
| 24734 | + // Link to full sample: |
| 24735 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24736 | + |
| 24737 | + |
| 24738 | + await Word.run(async (context) => { |
| 24739 | + // Deletes the first text box. |
| 24740 | + context.document.body.shapes |
| 24741 | + .getByTypes([Word.ShapeType.textBox]) |
| 24742 | + .getFirst() |
| 24743 | + .delete(); |
| 24744 | + await context.sync(); |
| 24745 | + |
| 24746 | + console.log("The first text box in document was deleted."); |
| 24747 | + }); |
| 24748 | +'Word.Shape#type:member': |
| 24749 | + - >- |
| 24750 | + // Link to full sample: |
| 24751 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24752 | + |
| 24753 | + |
| 24754 | + await Word.run(async (context) => { |
| 24755 | + // Gets text boxes in main document. |
| 24756 | + const shapes: Word.ShapeCollection = context.document.body.shapes; |
| 24757 | + shapes.load(); |
| 24758 | + await context.sync(); |
| 24759 | + |
| 24760 | + if (shapes.items.length > 0) { |
| 24761 | + shapes.items.forEach(function(shape, index) { |
| 24762 | + if (shape.type === Word.ShapeType.textBox) { |
| 24763 | + console.log(`Shape ${index} in the main document has a text box. Properties:`, shape); |
| 24764 | + } |
| 24765 | + }); |
| 24766 | + } else { |
| 24767 | + console.log("No shapes found in main document."); |
| 24768 | + } |
| 24769 | + }); |
| 24770 | +'Word.ShapeCollection:class': |
| 24771 | + - >- |
| 24772 | + // Link to full sample: |
| 24773 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24774 | + |
| 24775 | + |
| 24776 | + await Word.run(async (context) => { |
| 24777 | + // Gets text boxes in main document. |
| 24778 | + const shapes: Word.ShapeCollection = context.document.body.shapes; |
| 24779 | + shapes.load(); |
| 24780 | + await context.sync(); |
| 24781 | + |
| 24782 | + if (shapes.items.length > 0) { |
| 24783 | + shapes.items.forEach(function(shape, index) { |
| 24784 | + if (shape.type === Word.ShapeType.textBox) { |
| 24785 | + console.log(`Shape ${index} in the main document has a text box. Properties:`, shape); |
| 24786 | + } |
| 24787 | + }); |
| 24788 | + } else { |
| 24789 | + console.log("No shapes found in main document."); |
| 24790 | + } |
| 24791 | + }); |
| 24792 | +'Word.ShapeCollection#getByTypes:member(1)': |
| 24793 | + - >- |
| 24794 | + // Link to full sample: |
| 24795 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24796 | + |
| 24797 | + |
| 24798 | + await Word.run(async (context) => { |
| 24799 | + // Sets the properties of the first text box. |
| 24800 | + const firstShapeWithTextBox: Word.Shape = context.document.body.shapes |
| 24801 | + .getByTypes([Word.ShapeType.textBox]) |
| 24802 | + .getFirst(); |
| 24803 | + firstShapeWithTextBox.top = 115; |
| 24804 | + firstShapeWithTextBox.left = 0; |
| 24805 | + firstShapeWithTextBox.width = 50; |
| 24806 | + firstShapeWithTextBox.height = 50; |
| 24807 | + await context.sync(); |
| 24808 | + |
| 24809 | + console.log("The first text box's properties were updated:", firstShapeWithTextBox); |
| 24810 | + }); |
| 24811 | +'Word.ShapeCollection#getFirst:member(1)': |
| 24812 | + - >- |
| 24813 | + // Link to full sample: |
| 24814 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24815 | + |
| 24816 | + |
| 24817 | + await Word.run(async (context) => { |
| 24818 | + // Inserts a content control into the first paragraph in the first text box. |
| 24819 | + const firstShapeWithTextBox: Word.Shape = context.document.body.shapes |
| 24820 | + .getByTypes([Word.ShapeType.textBox]) |
| 24821 | + .getFirst(); |
| 24822 | + firstShapeWithTextBox.load("type/body"); |
| 24823 | + await context.sync(); |
| 24824 | + |
| 24825 | + const firstParagraphInTextBox: Word.Paragraph = firstShapeWithTextBox.body.paragraphs.getFirst(); |
| 24826 | + const newControl: Word.ContentControl = firstParagraphInTextBox.insertContentControl(); |
| 24827 | + newControl.load(); |
| 24828 | + await context.sync(); |
| 24829 | + |
| 24830 | + console.log("New content control properties:", newControl); |
| 24831 | + }); |
| 24832 | +'Word.ShapeType:enum': |
| 24833 | + - >- |
| 24834 | + // Link to full sample: |
| 24835 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml |
| 24836 | + |
| 24837 | + |
| 24838 | + await Word.run(async (context) => { |
| 24839 | + // Gets text boxes in main document. |
| 24840 | + const shapes: Word.ShapeCollection = context.document.body.shapes; |
| 24841 | + shapes.load(); |
| 24842 | + await context.sync(); |
| 24843 | + |
| 24844 | + if (shapes.items.length > 0) { |
| 24845 | + shapes.items.forEach(function(shape, index) { |
| 24846 | + if (shape.type === Word.ShapeType.textBox) { |
| 24847 | + console.log(`Shape ${index} in the main document has a text box. Properties:`, shape); |
| 24848 | + } |
| 24849 | + }); |
| 24850 | + } else { |
| 24851 | + console.log("No shapes found in main document."); |
| 24852 | + } |
| 24853 | + }); |
24590 | 24854 | 'Word.Style:class':
|
24591 | 24855 | - >-
|
24592 | 24856 | // Link to full sample:
|
|
0 commit comments