The SampleDoc.docx file will open in Word since it's set as the Start Document property of the add-in. On the Home tab in Word, in the OOXML Editor group, choose Open.Choose Debug > Start Debugging or choose the F5 key.Also set the Start Document to SampleDoc.docx. In the Properties window ( View > Properties Window), set the Start Action to Office Desktop Client.In Solution Explorer, select the WD_OpenXML_js project.Open the WD_OpenXML_js.sln file in Visual Studio 2019 or later.Microsoft 365 - Get a free developer sandbox that provides a renewable 90-day Microsoft 365 E5 developer subscription.Visual Studio 2019 or later with the Office/SharePoint development workload installed.Word on Windows, Mac, and in a browser.Shows the getOoxml and setOoxml methods to get and set OOXML content in Word 2016 and later.Shows the getSelectedDataAsync and setSelectedDataAsync methods to get and set OOXML content in Word 2013.Use OOXML if the API you need isn't available.
For an example, see the Insert formatted text code snippet in Script lab on Word. Important: We recommend you use APIs available in the Word API requirement sets as your first option. This sample Word add-in provides a scratch pad to get Office Open XML for your own content and test your own edited Office Open XML snippets.
Shows how to get, edit, and set OOXML content in a Word document.