-
Notifications
You must be signed in to change notification settings - Fork 63
/
office.diagnostics.yml
177 lines (128 loc) · 6.43 KB
/
office.diagnostics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
### YamlMime:TSType
name: Office.Diagnostics
uid: 'outlook!Office.Diagnostics:interface'
package: outlook!
fullName: Office.Diagnostics
summary: Provides diagnostic information to an Outlook add-in.
remarks: >-
\[ [API set: Mailbox 1.1](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!-- -->**:
**read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Compose or Read
Starting with Mailbox requirement set 1.5, you can also use the
[Office.context.diagnostics](https://learn.microsoft.com/javascript/api/office/office.context?view=outlook-js-1.5&preserve-view=true#office-office-context-diagnostics-member)
property to get similar information.
#### Examples
```TypeScript
// 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;
}
```
isPreview: false
isDeprecated: false
type: interface
properties:
- name: hostName
uid: 'outlook!Office.Diagnostics#hostName:member'
package: outlook!
fullName: hostName
summary: >-
Gets a string that represents the type of Outlook client.
The string can be one of the following values: `Outlook`<!-- -->, `newOutlookWindows`<!-- -->, `OutlookWebApp`<!--
-->, `OutlookIOS`<!-- -->, or `OutlookAndroid`<!-- -->.
remarks: >-
\[ [API set: Mailbox 1.1](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose or Read
**Important**: The `Outlook` value is returned for Outlook desktop clients on Windows and on Mac.
`newOutlookWindows` is returned for the [new Outlook on Windows desktop
client](https://insider.microsoft365.com/blog/new-outlook-for-windows-available-to-all-office-insiders) currently
in preview.
isPreview: false
isDeprecated: false
syntax:
content: 'hostName: string;'
return:
type: string
- name: hostVersion
uid: 'outlook!Office.Diagnostics#hostVersion:member'
package: outlook!
fullName: hostVersion
summary: >-
Gets a string that represents the version of either the Outlook client or the Exchange Server (for example,
"15.0.468.0").
If the mail add-in is running in Outlook on a desktop or mobile client, the `hostVersion` property returns the
version of the Outlook client. In Outlook on the web, the property returns the version of the Exchange Server.
remarks: >-
\[ [API set: Mailbox 1.1](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose or Read
isPreview: false
isDeprecated: false
syntax:
content: 'hostVersion: string;'
return:
type: string
- name: OWAView
uid: 'outlook!Office.Diagnostics#OWAView:member'
package: outlook!
fullName: OWAView
summary: >-
Gets a string that represents the current view of Outlook on the web.
The returned string can be one of the following values: `OneColumn`<!-- -->, `TwoColumns`<!-- -->, or
`ThreeColumns`<!-- -->.
If the application is not Outlook on the web, then accessing this property results in undefined.
Outlook on the web has three views that correspond to the width of the screen and the window, and the number of
columns that can be displayed:
- `OneColumn`<!-- -->, which is displayed when the screen is narrow. Outlook on the web uses this single-column
layout on the entire screen of a smartphone.
- `TwoColumns`<!-- -->, which is displayed when the screen is wider. Outlook on the web uses this view on most
tablets.
- `ThreeColumns`<!-- -->, which is displayed when the screen is wide. For example, Outlook on the web uses this
view in a full screen window on a desktop computer.
remarks: >-
\[ [API set: Mailbox 1.1](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose or Read
isPreview: false
isDeprecated: false
syntax:
content: 'OWAView: MailboxEnums.OWAView | "OneColumn" | "TwoColumns" | "ThreeColumns";'
return:
type: '<xref uid="outlook!Office.MailboxEnums.OWAView:enum" /> | "OneColumn" | "TwoColumns" | "ThreeColumns"'