Env: Mac Office 2016 bauen 15,26Wort Lese CustomXMLParts wird intermittierend stecken
Ich bin die Word-Dokumente CustomXMLParts Lesen nach Office.initialize beendet ist. Ich verwende die Office.context.document.customXmlParts.getByNamespaceAsync-API. Der getByNamespaceAsync bleibt zeitweise hängen. Sobald ich in das Word-Dokument klicke, fährt die API fort und liest CustomXmlParts erfolgreich.
Irgendwelche Arbeiten um dieses? Ich versuchte auch, context.document.getSelection aufzurufen, um Cursor-Klick nachzuahmen, aber half nicht.
Office.context.document.customXmlParts.getByNamespaceAsync("MyXmlTag", function (asyncResult) {
if (asyncResult.value.length > 0) {
asyncResult.value[0].getNodesAsync("/", function (asyncNodeResult) {
if (asyncNodeResult.status == Office.AsyncResultStatus.Failed) {
console.log(" Failed to read word document. " + JSON.stringify(asyncResult));
} else {
asyncNodeResult.value[0].getNodeValueAsync(function (result) {
if (result.status == Office.AsyncResultStatus.Failed) {
console.log(" getNodeValueAsync: Failed " + JSON.stringify(asyncResult));
}
else {
//result.valuse is xml data
}
});
}
});
}
else {
console.log(" CustomXML part is not found");
}
});
`
vielen Dank für die Meldung dieses Problems. Wir untersuchen aktiv und liefern bald Ergebnisse. Haben Sie eine Beispiel-XML dafür verwendet? Vielen Dank! –