I am struggling to load the file named item1.xml from the ..\customXml folder of my document into my Word Add-In.
So far, I have attempted the following:
var url = Office.context.document.url + '\\customXml\\item1.xml\\'
Office.context.document.customXmlParts.getByNamespaceAsync(url, (result) => {
console.log("2");
if (result.value.length > 0) {
console.log("3");
for (var i = 0; i < result.value.length; i++) {
}
}
});
and
Office.context.document.customXmlParts.getByIdAsync(
"{ABA6B192-6371-4776-85AA-46BD32014394}", (result) => {
The second method works perfectly, but I am unsure how to retrieve the ID without having to open the Word document with zip. The first method only logs "2" and does not proceed to "3".
If anyone has a solution, please let me know!