Office.AsyncContextOptions interface
Fournit une option permettant de conserver les données de contexte de tout type, inchangées, pour une utilisation dans un rappel.
Remarques
Utilisateur
- Office.AppointmentCompose : addFileAttachmentAsync, addFileAttachmentFromBase64Async, addHandlerAsync, addItemAttachmentAsync, disableClientSignatureAsync, getAttachmentContentAsync, getAttachmentsAsync, getInitializationContextAsync, getItemIdAsync, getSelectedDataAsync, getSharedPropertiesAsync, isClientSignatureEnabledAsync, removeAttachmentAsync, removeHandlerAsync, saveAsync, sendAsync, setSelectedDataAsync
- Office.AppointmentRead : addHandlerAsync, displayReplyAllFormAsync, displayReplyFormAsync, getAttachmentContentAsync, getInitializationContextAsync, getSharedPropertiesAsync, removeHandlerAsync
- Office.Binding : addHandlerAsync
- Office.Bindings : getAllAsync, getByIdAsync, releaseByIdAsync
- Office.Body : appendOnSendAsync, getAsync, getTypeAsync, prependAsync, prependOnSendAsync, setAsync, setSelectedDataAsync, setSignatureAsync
- Office.Categories : addAsync, getAsync, removeAsync
- Office.CustomXmlNode : getNodesAsync, getNodeValueAsync, getTextAsync, getXmlAsync, setNodeValueAsync, setTextAsync, setXmlAsync
- Office.CustomXmlPart : addHandlerAsync, deleteAsync, getNodesAsync, getXmlAsync
- Office.CustomXmlParts : addAsync, getByIdAsync, getByNamespaceAsync
- Office.CustomXmlPrefixMappings : addNamespaceAsync, getNamespaceAsync, getPrefixAsync
- Office.DelayDeliveryTime : getAsync, setAsync
- Office.DevicePermission : requestPermissionsAsync
- Office.DisplayedBody : setAsync
- Office.DisplayedSubject : setAsync
- Office.Document : addHandlerAsync, getActiveViewAsync, getFilePropertiesAsync, getMaxResourceIndexAsync, getMaxTaskIndexAsync, getProjectFieldAsync, getResourceByIndexAsync, getResourceFieldAsync, getSelectedResourceAsync, getSelectedTaskAsync, getSelectedViewAsync, getTaskAsync, getTaskAsync, getTaskFieldAsync, getWSSUrlAsync, setResourceFieldAsync, setTaskFieldAsync
- Office.EnhancedLocation : addAsync, getAsync, removeAsync
- Office.Ews : getTokenStatusAsync
- Office.From : getAsync
- Office.InternetHeaders : getAsync, removeAsync, setAsync
- Office.IsAllDayEvent : getAsync, setAsync
- Office.LoadedMessageCompose : getAttachmentContentAsync, getAttachmentsAsync, getComposeTypeAsync, getConversationIndexAsync, getInitializationContextAsync, getItemClassAsync, getItemIdAsync, getSharedPropertiesAsync, isClientSignatureEnabledAsync, saveAsync, unloadAsync
- Office.LoadedMessageRead : displayReplyAllFormAsync, displayReplyFormAsync, getAllInternetHeadersAsync, getAsFileAsync, getAttachmentContentAsync, getInitializationContextAsync, getSharedPropertiesAsync, unloadAsync
- Office.Location : getAsync, setAsync
- Office.Mailbox : addHandlerAsync, displayAppointmentFormAsync, displayMessageFormAsync, displayNewAppointmentFormAsync, displayNewMessageFormAsync, getCallbackTokenAsync, getSelectedItemsAsync, loadItemByIdAsync, removeHandlerAsync
- Office.MasterCategories : addAsync, getAsync, removeAsync
- Office.MessageCompose : addFileAttachmentAsync, addFileAttachmentFromBase64Async, addHandlerAsync, addItemAttachmentAsync, closeAsync, disableClientSignatureAsync, getAttachmentContentAsync, getAttachmentsAsync, getComposeTypeAsync, getConversationIndexAsync, getInitializationContextAsync, getItemClassAsync, getItemIdAsync, getSelectedDataAsync, getSharedPropertiesAsync, isClientSignatureEnabledAsync, removeAttachmentAsync, removeHandlerAsync, saveAsync, sendAsync, setSelectedDataAsync
- Office.MessageRead : addHandlerAsync, displayReplyAllFormAsync, displayReplyFormAsync, getAllInternetHeadersAsync, getAsFileAsync, getAttachmentContentAsync, getInitializationContextAsync, getSharedPropertiesAsync, removeHandlerAsync
- Office.NotificationMessages : addAsync, getAllAsync, removeAsync, replaceAsync
- Office.Organizer : getAsync
- Office.Recipients : addAsync, getAsync, setAsync
- Office.Recurrence : getAsync, setAsync
- Office.ReplyFormData : options
- Office.Sensitivity : getAsync, setAsync
- Office.SensitivityLabel : getAsync, setAsync
- Office.SensitivityLabelsCatalog : getAsync, getIsEnabledAsync
- Office.SessionData : clearAsync, removeAsync, setAsync
- Office.Settings : addHandlerAsync
- Office.Subject : getAsync, setAsync
- Office.TableBinding : addColumnsAsync, addRowsAsync, clearFormatsAsync, deleteAllDataValuesAsync, getFormatsAsync, setFormatsAsync, setTableOptionsAsync
- Office.Time : getAsync, setAsync
- Office.UI : addHandlerAsync
Exemples
// The following example gets the attachment contents of the
// current mail item being composed in Outlook.
function getAttachmentContentCompose() {
const item = Office.context.mailbox.item;
const options: Office.AsyncContextOptions = { asyncContext: { currentItem: item } };
item.getAttachmentsAsync(options, callback);
function callback(result) {
if (result.status === Office.AsyncResultStatus.Failed) {
console.log(result.error.message);
return;
}
if (result.value.length <= 0) {
console.log("Mail item has no attachments.");
return;
}
const currentItem = result.asyncContext.currentItem;
for (let i = 0; i < result.value.length; i++) {
currentItem.getAttachmentContentAsync(result.value[i].id, (asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log(asyncResult.error.message);
return;
}
console.log(asyncResult.value.content);
});
}
}
}
Propriétés
| async |
Élément défini par l’utilisateur de tout type retourné, inchangé, dans la |
Détails de la propriété
asyncContext
Élément défini par l’utilisateur de tout type retourné, inchangé, dans la asyncContext propriété de l’objet AsyncResult passé à un rappel.
asyncContext?: any
Valeur de propriété
any