none
Sharepoint word web add-in how to replace or insert text in document when document open in browser. RRS feed

  • Question

  • I am very depressed near to die due to word web add-in. It's working fine on local but not working with word online.

    Basically i have customxml in word document and i want to insert text using word JavaScript api.

    Is there any solution for customxml in word online.

    Here is my code . it's working fine on local word but not working on word online.

    function updateCustomXml(){
    Office.context.document.customXmlParts.getByNamespaceAsync(nameSpace, function (asyncResult1) {
                    if (asyncResult1.value != null && asyncResult1.value.length > 0) {
                        asyncResult1.value[0].getNodesAsync("/ns0:properties[1]/documentManagement[1]/*[local-name() = '" + documentNode + "'][1]", function (nodeResults) {
                            if (nodeResults.value != null && nodeResults.value.length > 0) {
                                var = stringReplace = "<SupplierNumber xmlns="123dsad2ssssas1asd12d">12345</SupplierNumber>";
                                nodeResults.value[0].setXmlAsync(stringReplace, function (nodeReplace) {
    							console.log("Text Insert Successfully");
                                });
                            }
                        });
                    }
                });
            }
    }

    Thursday, August 29, 2019 1:36 PM