【发布时间】:2016-06-28 12:35:42
【问题描述】:
我在 excel 中问过一个关于 How to get the formatting of a Cell using Office.js 的问题。我又遇到了同样的问题,但这次是关于 ms-word,我有可能获得在 word 应用程序中创建的表格单元格中的格式化文本。
虽然我能够将选定的文本作为 html 获取,这给了我所需的样式
Office.context.document.getSelectedDataAsync(Office.CoercionType.Html,
function (result) {
if (result.status === Office.AsyncResultStatus.Succeeded) {
showNotification('The selected text is:', '"' + result.value + '"');
} else {
showNotification('Error:', result.error.message);
}
});
我只想要当前单元格格式的文本 谢谢!
【问题讨论】:
标签: javascript office-js office-app