在我的代码中,我试图更改页脚的字体样式。当我运行以下代码时,我的页脚消失了。
function applyFontPreference(optionNo){
Word.run(function (context) {
const sections = context.document.sections;
sections.load('body/font');
return context.sync().then(function(){
var footer = sections.items[0].getFooter("Primary")
footer.font.name = "Arial";
});
}).catch(function (error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
};
});
}