Office.SessionData interface

Stellt Methoden zum Verwalten der Sitzungsdaten eines Elements bereit.

Wichtig: Das gesamte SessionData-Objekt ist auf 50.000 Zeichen pro Add-In beschränkt.

Hinweise

[ API-Satz: Postfach 1.11 ]

Mindestberechtigungsstufe: Element lesen

Anwendbarer Outlook-Modus: Verfassen

Methoden

clearAsync(options, callback)

Löscht alle Schlüssel-Wert-Paare der Sitzungsdaten.

clearAsync(callback)

Löscht alle Schlüssel-Wert-Paare der Sitzungsdaten.

getAllAsync(callback)

Ruft alle Schlüssel-Wert-Paare der Sitzungsdaten ab.

getAsync(name, callback)

Ruft den Sitzungsdatenwert des angegebenen Schlüssels ab.

removeAsync(name, options, callback)

Entfernt ein Schlüssel-Wert-Paar für Sitzungsdaten.

removeAsync(name, callback)

Entfernt ein Schlüssel-Wert-Paar für Sitzungsdaten.

setAsync(name, value, options, callback)

Legt ein Schlüssel-Wert-Paar für Sitzungsdaten fest.

Wichtig: Das gesamte SessionData-Objekt ist auf 50.000 Zeichen pro Add-In beschränkt.

setAsync(name, value, callback)

Legt ein Schlüssel-Wert-Paar für Sitzungsdaten fest.

Wichtig: Das gesamte SessionData-Objekt ist auf 50.000 Zeichen pro Add-In beschränkt.

Details zur Methode

clearAsync(options, callback)

Löscht alle Schlüssel-Wert-Paare der Sitzungsdaten.

clearAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameter

options
Office.AsyncContextOptions

Ein Objektliteral, das eine oder mehrere der folgenden Eigenschaften enthält: asyncContextEntwickler können jedes Objekt bereitstellen, auf das sie in der Rückruffunktion zugreifen möchten.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter aufgerufen, asyncResult, der ein Office.AsyncResult -Objekt ist.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Minimale Berechtigungsstufe: Element lesen/schreiben

Anwendbarer Outlook-Modus: Verfassen

Beispiele

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/session-data-apis.yaml

Office.context.mailbox.item.sessionData.clearAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    console.log("sessionData.clearAsync succeeded");
  } else {
    console.log("Failed to clear sessionData. Error: " + JSON.stringify(asyncResult.error));
  }
});

clearAsync(callback)

Löscht alle Schlüssel-Wert-Paare der Sitzungsdaten.

clearAsync(callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameter

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter aufgerufen, asyncResult, der ein Office.AsyncResult -Objekt ist.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Minimale Berechtigungsstufe: Element lesen/schreiben

Anwendbarer Outlook-Modus: Verfassen

getAllAsync(callback)

Ruft alle Schlüssel-Wert-Paare der Sitzungsdaten ab.

getAllAsync(callback: (asyncResult: Office.AsyncResult<string>) => void): void;

Parameter

callback

(asyncResult: Office.AsyncResult<string>) => void

Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter aufgerufen, asyncResult, der ein Office.AsyncResult -Objekt ist.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Minimale Berechtigungsstufe: Element lesen/schreiben

Anwendbarer Outlook-Modus: Verfassen

Beispiele

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/session-data-apis.yaml

Office.context.mailbox.item.sessionData.getAllAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    console.log("The sessionData is " + JSON.stringify(asyncResult.value));
  } else {
    console.log("Failed to get all sessionData. Error: " + JSON.stringify(asyncResult.error));
  }
});

getAsync(name, callback)

Ruft den Sitzungsdatenwert des angegebenen Schlüssels ab.

getAsync(name: string, callback: (asyncResult: Office.AsyncResult<string>) => void): void;

Parameter

name

string

Der Sitzungsdatenschlüssel.

callback

(asyncResult: Office.AsyncResult<string>) => void

Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter vom Typ Office.AsyncResultaufgerufen.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Mindestberechtigungsstufe: Element lesen

Anwendbarer Outlook-Modus: Verfassen

Beispiele

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/session-data-apis.yaml

Office.context.mailbox.item.sessionData.getAsync(
  "Date",
  function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    console.log("The sessionData value is " + JSON.stringify(asyncResult.value));
  } else {
    console.log("Failed to get sessionData. Error: " + JSON.stringify(asyncResult.error));
  }
});

removeAsync(name, options, callback)

Entfernt ein Schlüssel-Wert-Paar für Sitzungsdaten.

removeAsync(name: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameter

name

string

Der Sitzungsdatenschlüssel.

options
Office.AsyncContextOptions

Ein Objektliteral, das eine oder mehrere der folgenden Eigenschaften enthält: asyncContextEntwickler können jedes Objekt bereitstellen, auf das sie in der Rückruffunktion zugreifen möchten.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter aufgerufen, asyncResult, der ein Office.AsyncResult -Objekt ist.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Minimale Berechtigungsstufe: Element lesen/schreiben

Anwendbarer Outlook-Modus: Verfassen

Beispiele

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/session-data-apis.yaml

Office.context.mailbox.item.sessionData.removeAsync(
  "Date",
  function callback(asyncResult) {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
      console.log("sessionData.removeAsync succeeded");
    } else {
      console.log("Failed to remove sessionData. Error: " + JSON.stringify(asyncResult.error));
    }
  }
);

removeAsync(name, callback)

Entfernt ein Schlüssel-Wert-Paar für Sitzungsdaten.

removeAsync(name: string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameter

name

string

Der Sitzungsdatenschlüssel.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter aufgerufen, asyncResult, der ein Office.AsyncResult -Objekt ist.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Minimale Berechtigungsstufe: Element lesen/schreiben

Anwendbarer Outlook-Modus: Verfassen

setAsync(name, value, options, callback)

Legt ein Schlüssel-Wert-Paar für Sitzungsdaten fest.

Wichtig: Das gesamte SessionData-Objekt ist auf 50.000 Zeichen pro Add-In beschränkt.

setAsync(name: string, value: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameter

name

string

Der Sitzungsdatenschlüssel.

value

string

Der Sitzungsdatenwert als Zeichenfolge.

options
Office.AsyncContextOptions

Ein Objektliteral, das eine oder mehrere der folgenden Eigenschaften enthält: asyncContextEntwickler können jedes Objekt bereitstellen, auf das sie in der Rückruffunktion zugreifen möchten.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter vom Typ Office.AsyncResultaufgerufen.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Mindestberechtigungsstufe: Element lesen

Anwendbarer Outlook-Modus: Verfassen

Beispiele

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/session-data-apis.yaml

Office.context.mailbox.item.sessionData.setAsync(
  "Date",
  "7/24/2020",
  function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    console.log("sessionData.setAsync succeeded");
  } else {
    console.log("Failed to set sessionData. Error: " + JSON.stringify(asyncResult.error));
  }
});

setAsync(name, value, callback)

Legt ein Schlüssel-Wert-Paar für Sitzungsdaten fest.

Wichtig: Das gesamte SessionData-Objekt ist auf 50.000 Zeichen pro Add-In beschränkt.

setAsync(name: string, value: string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameter

name

string

Der Sitzungsdatenschlüssel.

value

string

Der Sitzungsdatenwert als Zeichenfolge.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. Wenn die -Methode abgeschlossen ist, wird die im callback -Parameter übergebene Funktion mit einem einzelnen Parameter vom Typ Office.AsyncResultaufgerufen.

Gibt zurück

void

Hinweise

[ API-Satz: Postfach 1.11 ]

Mindestberechtigungsstufe: Element lesen

Anwendbarer Outlook-Modus: Verfassen