Skip to content

Commit d0cb81e

Browse files
[Word] (Shapes) Handle Compatibility Mode (#5099)
1 parent 4db8f74 commit d0cb81e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
5.18 KB
Loading

docs/word/word-add-ins-troubleshooting.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Troubleshoot Word add-ins
33
description: Learn how to troubleshoot development errors in Word add-ins.
4-
ms.date: 02/25/2025
4+
ms.date: 03/26/2025
55
ms.topic: troubleshooting
66
ms.localizationpriority: medium
77
---
@@ -108,6 +108,26 @@ The [Word.Table](/javascript/api/word/word.table) object is different from an [H
108108

109109
Similarly, don't use Word JavaScript APIs to interact with HTML table objects.
110110

111+
## Shape APIs can't find shapes
112+
113+
You have shapes in your document but for some reason, when you used the API to get shapes e.g., `context.document.body.shapes`, the result is that 0 shapes were found.
114+
115+
One possibility is that the Word template is outdated. If you created a new document from the default template yet you see "Compatibility Mode" in the Word window's title bar, consider updating your default template.
116+
117+
:::image type="content" source="../images/word-compatibility-mode.png" alt-text="Compatibility Mode displayed in Word window's title bar.":::
118+
119+
To change the default template, see [Change the Normal template (Normal.dotm)](https://support.microsoft.com/office/06de294b-d216-47f6-ab77-ccb5166f98ea).
120+
121+
1. Use the instructions to find the location of the Normal template on your machine.
122+
1. Ensure that Word is closed.
123+
1. Rename `Normal.dotm` in **File Explorer** or similar application. Or you can move `Normal.dotm` to another location.
124+
125+
> [!IMPORTANT]
126+
> Because you renamed or moved `Normal.dotm`, Word automatically creates a new version the next time you open Word. Any customizations in your original `Normal.dotm` won't transfer to the new version so you'll need to add your customizations to the new template.
127+
128+
1. Open Word and create a new document using the default template. You should no longer see "Compatibility Mode".
129+
1. Retry running your code using the Shape API.
130+
111131
## See also
112132

113133
- [Troubleshoot development errors with Office Add-ins](../testing/troubleshoot-development-errors.md)

0 commit comments

Comments
 (0)