1,066 questions
How to insert Header and footer data with insertooxml
Vinod Kumar
6
Reputation points
I have open xml file, which has Body data, Header data and Footer data. I am trying to insert data with
context.document.body.insertOoxml(WORD_DATA, "Start"); //WORD_DATA is in XML string
Or
Office.context.document.setSelectedDataAsync(WORD_DATA,{coercionType:Office.CoercionType.Ooxml},(res)=>{
console.log(res);
})
In both cases body data only inserting but not Header and footer. How to extract Header and Footer in the respective sections
I tried this also
var myFooter = mySections.items[0].getFooter(Word.HeaderFooterType.primary);
myFooter.insertOoxml(WORD_DATA, Word.InsertLocation.end);
In this case also inserting Body data only. How to insert Header and Footer data from XML string
Microsoft 365 and Office Development Office JavaScript API
Microsoft 365 and Office Development Other
4,374 questions
Microsoft 365 and Office Word For business Windows
1,932 questions
Sign in to answer