Office.CoercionType enum
Especifica como forçar dados retornados ou definidos pelo método invocado.
Comentários
O suporte de aplicações e plataformas para cada CoercionType um é especificado nas seguintes descrições do conjunto de requisitos.
HtmlCoercion, (ao utilizar
Office.CoercionType.Html)ImageCoercion 1.1 (ao utilizar
Office.CoercionType.Image)MatrixCoercion (ao utilizar
Office.CoercionType.Matrix)OoxmlCoercion (ao utilizar
Office.CoercionType.Ooxml)TableCoercion (ao utilizar
Office.CoercionType.Table)TextCoercion (ao utilizar
Office.CoercionType.Text)ImageCoercion 1.2 (ao utilizar
Office.CoercionType.XmlSvg)
Exemplos
// This function displays the currently selected text in the console.
// It uses the Common APIs.
function run() {
Office.context.document.getSelectedDataAsync(Office.CoercionType.Text, (asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.error(asyncResult.error.message);
} else {
console.log(`The selected data is "${asyncResult.value}".`);
}
});
}