Office.MailboxEnums.OWAView enum

Represents the current view of Outlook on the web.

Remarks

Examples

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

// This function gets a mailbox's diagnostic information, such as Outlook client and version, and logs it to the console.
const diagnostics = Office.context.mailbox.diagnostics;
console.log(`Client application: ${diagnostics.hostName}`);
console.log(`Client version: ${diagnostics.hostVersion}`);

switch (diagnostics.OWAView) {
  case undefined:
    console.log("Current view (Outlook on the web only): Not applicable. An Outlook desktop client is in use.");
    break;
  case Office.MailboxEnums.OWAView.OneColumnNarrow:
    console.log("Current view (Outlook on the web only): Viewed from an older generation mobile phone");
    break;
  case Office.MailboxEnums.OWAView.OneColumn:
    console.log("Current view (Outlook on the web only): Viewed from a newer generation mobile phone");
    break;
  case Office.MailboxEnums.OWAView.TwoColumns:
    console.log("Current view (Outlook on the web only): Viewed from a tablet");
    break;
  case Office.MailboxEnums.OWAView.ThreeColumns:
    console.log("Current view (Outlook on the web only): Viewed from a desktop computer");
    break;
}

Fields

OneColumnNarrow = "OneColumnNarrow"

Narrow one-column view. Displayed when the screen width is less than 436 pixels. For example, Outlook on the web uses this view on the entire screen of older smartphones.

OneColumn = "OneColumn"

One-column view. Displayed when the screen width is greater than or equal to 436 pixels, but less than 536 pixels. For example, Outlook on the web uses this view on the entire screen of newer smartphones.

TwoColumns = "TwoColumns"

Two-column view. Displayed when the screen width is greater than or equal to 536 pixels, but less than 780 pixels. For example, Outlook on the web uses this view on most tablets.

ThreeColumns = "ThreeColumns"

Three-column view. Displayed when the screen width is greater than or equal to 780 pixels. For example, Outlook on the web uses this view in a full screen window on a desktop computer.