-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathget-message-properties.yaml
82 lines (75 loc) · 3.45 KB
/
get-message-properties.yaml
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
order: 23
id: outlook-other-item-apis-get-message-properties
name: 'Get properties of selected messages (Message Compose, Message Read)'
description: Gets the properties of multiple selected messages.
host: OUTLOOK
api_set:
Mailbox: '1.14'
script:
content: |
Office.onReady(() => {
// Registers an event handler to identify when messages are selected.
Office.context.mailbox.addHandlerAsync(Office.EventType.SelectedItemsChanged, getMessageProperties, (asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log(asyncResult.error.message);
return;
}
console.log("Event handler added for the SelectedItemsChanged event.");
});
});
function getMessageProperties() {
// Retrieves the selected messages' properties and logs them to the console.
Office.context.mailbox.getSelectedItemsAsync((asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log(asyncResult.error.message);
return;
}
asyncResult.value.forEach((message) => {
console.log(`Item ID: ${message.itemId}`);
console.log(`Conversation ID: ${message.conversationId}`);
console.log(`Internet message ID: ${message.internetMessageId}`);
console.log(`Subject: ${message.subject}`);
console.log(`Item type: ${message.itemType}`);
console.log(`Item mode: ${message.itemMode}`);
console.log(`Has attachment: ${message.hasAttachment}`);
});
});
}
language: typescript
template:
content: |-
<section class="ms-Fabric ms-font-m">
<p>This sample shows how to get the properties of multiple selected messages.</p>
<p><b>Required mode</b>: Message Compose, Message Read</p>
</section>
<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<ol>
<li><p>Turn on the Reading Pane in Outlook. For guidance, see <a href="https://support.microsoft.com/office/2fd687ed-7fc4-4ae3-8eab-9f9b8c6d53f0" target="_blank">Use and configure the Reading Pane to preview messages</a>.</p></li>
<li><p>Hold <kbd>Ctrl</kbd> (Windows) or <kbd>Cmd</kbd> (Mac) while selecting multiple messages from your mailbox. You can select a maximum of 100 messages at a time.</p></li>
</ol>
<p>The properties of the selected messages are automatically logged to the console.</p>
<p>To learn more about the item multi-select feature, see <a href="https://learn.microsoft.com/office/dev/add-ins/outlook/item-multi-select" target="_blank">Activate your Outlook add-in on multiple messages</a>.</p>
</section>
language: html
style:
content: |-
section.samples {
margin-top: 20px;
}
section.samples .ms-Button, section.setup .ms-Button {
display: block;
margin-bottom: 5px;
margin-left: 20px;
min-width: 80px;
}
language: css
libraries: |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
[email protected]/dist/css/fabric.min.css
[email protected]/dist/css/fabric.components.min.css
[email protected]/client/core.min.js
@types/core-js
@types/[email protected]