Office.CoercionType enum
Gibt an, wie Daten umgewandelt werden sollen, die von der aufgerufenen Methode zurückgegeben oder festgelegt wurden.
Hinweise
Die jeweilige CoercionType Anwendungs- und Plattformunterstützung ist in den folgenden Beschreibungen des Anforderungssatzes festgelegt.
HtmlCoercion (bei Verwendung
Office.CoercionType.Htmlvon )ImageCoercion 1.1 (bei Verwendung von
Office.CoercionType.Image)MatrixCoercion (bei Verwendung
Office.CoercionType.Matrix)OoxmlCoercion (bei Verwendung
Office.CoercionType.Ooxml)TableCoercion (bei Verwendung
Office.CoercionType.Table)TextCoercion (bei Verwendung von
Office.CoercionType.Text)ImageCoercion 1.2 (bei Verwendung von
Office.CoercionType.XmlSvg)
Verwendet von
- Office.AppointmentCompose: getSelectedDataAsync
- Office.Body: getAsync, getTypeAsync
- Office.CoercionTypeOptions: coercionType
- Office.DecryptedMessageBody: coercionType
- Office.Document: getSelectedDataAsync
- Office.GetBindingDataOptions: coercionType
- Office.MessageCompose: getSelectedDataAsync
- Office.SetBindingDataOptions: coercionType
- Office.SetSelectedDataOptions: coercionType
Beispiele
// 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}".`);
}
});
}