Skip to content

Commit d28ab6b

Browse files
[Outlook] Code snippet updates (#2233)
* Run build script * Remove redundant scripts
1 parent d1aaa23 commit d28ab6b

File tree

122 files changed

+124
-12195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+124
-12195
lines changed

docs/code-snippets/outlook-snippets.yaml

Lines changed: 19 additions & 475 deletions
Large diffs are not rendered by default.

docs/docs-ref-autogen/outlook/outlook/office.appointmentcompose.yml

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -209,30 +209,6 @@ properties:
209209
#### Examples
210210
211211
212-
```TypeScript
213-
214-
// The following example sets the end time of an appointment in compose mode by
215-
216-
// using the `setAsync` method of the `Time` object.
217-
218-
const endTime = new Date("3/14/2015");
219-
220-
const options = {
221-
// Pass information that can be used in the callback.
222-
asyncContext: {verb: "Set"}
223-
};
224-
225-
Office.context.mailbox.item.end.setAsync(endTime, options, function(result) {
226-
if (result.error) {
227-
console.debug(result.error);
228-
} else {
229-
// Access the asyncContext that was passed to the setAsync method.
230-
console.debug("End Time " + result.asyncContext.verb);
231-
}
232-
});
233-
234-
```
235-
236212
```TypeScript
237213
238214
// Link to full sample:
@@ -502,20 +478,6 @@ properties:
502478
#### Examples
503479
504480
505-
```TypeScript
506-
507-
const userContext = { value : 1 };
508-
509-
Office.context.mailbox.item.location.getAsync( { context: userContext}, callback);
510-
511-
512-
function callback(asyncResult) {
513-
const context = asyncResult.context;
514-
const location = asyncResult.value;
515-
}
516-
517-
```
518-
519481
```TypeScript
520482
521483
// Link to full sample:
@@ -700,21 +662,6 @@ properties:
700662
#### Examples
701663
702664
703-
```TypeScript
704-
705-
Office.context.mailbox.item.optionalAttendees.setAsync( ['[email protected]', '[email protected]'] );
706-
707-
Office.context.mailbox.item.optionalAttendees.addAsync( ['[email protected]'] );
708-
709-
Office.context.mailbox.item.optionalAttendees.getAsync(callback);
710-
711-
712-
function callback(asyncResult) {
713-
const arrayOfOptionalAttendeesRecipients = asyncResult.value;
714-
}
715-
716-
```
717-
718665
```TypeScript
719666
720667
// Link to full sample:
@@ -949,22 +896,6 @@ properties:
949896
#### Examples
950897
951898
952-
```TypeScript
953-
954-
Office.context.mailbox.item.requiredAttendees.setAsync( ['[email protected]', '[email protected]'] );
955-
956-
Office.context.mailbox.item.requiredAttendees.addAsync( ['[email protected]'] );
957-
958-
Office.context.mailbox.item.requiredAttendees.getAsync(callback);
959-
960-
961-
function callback(asyncResult) {
962-
const arrayOfRequiredAttendeesRecipients = asyncResult.value;
963-
console.log(JSON.stringify(arrayOfRequiredAttendeesRecipients));
964-
}
965-
966-
```
967-
968899
```TypeScript
969900
970901
// Link to full sample:

docs/docs-ref-autogen/outlook/outlook/office.appointmentread.yml

Lines changed: 0 additions & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -55,33 +55,6 @@ properties:
5555
#### Examples
5656
5757
58-
```TypeScript
59-
60-
// The following code builds an HTML string with details of all attachments on the current item.
61-
62-
const item = Office.context.mailbox.item;
63-
64-
let outputString = "";
65-
66-
67-
if (item.attachments.length > 0) {
68-
for (let i = 0 ; i < item.attachments.length ; i++) {
69-
const attachment = item.attachments[i];
70-
outputString += "<BR>" + i + ". Name: ";
71-
outputString += attachment.name;
72-
outputString += "<BR>ID: " + attachment.id;
73-
outputString += "<BR>contentType: " + attachment.contentType;
74-
outputString += "<BR>size: " + attachment.size;
75-
outputString += "<BR>attachmentType: " + attachment.attachmentType;
76-
outputString += "<BR>isInline: " + attachment.isInline;
77-
}
78-
}
79-
80-
81-
console.log(outputString);
82-
83-
```
84-
8558
```TypeScript
8659
8760
// Link to full sample:
@@ -644,14 +617,6 @@ properties:
644617
#### Examples
645618
646619
647-
```TypeScript
648-
649-
const location = Office.context.mailbox.item.location;
650-
651-
console.log("location: " + location);
652-
653-
```
654-
655620
```TypeScript
656621
657622
// Link to full sample:
@@ -1403,92 +1368,6 @@ methods:
14031368
#### Examples
14041369
14051370
1406-
```TypeScript
1407-
1408-
// The following code passes a string to the `displayReplyAllForm` method.
1409-
1410-
Office.context.mailbox.item.displayReplyAllForm('hello there');
1411-
1412-
Office.context.mailbox.item.displayReplyAllForm('<b>hello there</b>');
1413-
1414-
1415-
// Reply with an empty body.
1416-
1417-
Office.context.mailbox.item.displayReplyAllForm({});
1418-
1419-
1420-
// Reply with just a body.
1421-
1422-
Office.context.mailbox.item.displayReplyAllForm(
1423-
1424-
{
1425-
1426-
'htmlBody' : 'hi'
1427-
1428-
});
1429-
1430-
1431-
// Reply with a body and a file attachment.
1432-
1433-
Office.context.mailbox.item.displayReplyAllForm(
1434-
1435-
{
1436-
'htmlBody' : 'hi',
1437-
'attachments' :
1438-
[
1439-
{
1440-
'type' : Office.MailboxEnums.AttachmentType.File,
1441-
'name' : 'squirrel.png',
1442-
'url' : 'http://i.imgur.com/sRgTlGR.jpg'
1443-
}
1444-
]
1445-
});
1446-
1447-
1448-
// Reply with a body and an item attachment.
1449-
1450-
Office.context.mailbox.item.displayReplyAllForm(
1451-
1452-
{
1453-
'htmlBody' : 'hi',
1454-
'attachments' :
1455-
[
1456-
{
1457-
'type' : 'item',
1458-
'name' : 'rand',
1459-
'itemId' : Office.context.mailbox.item.itemId
1460-
}
1461-
]
1462-
});
1463-
1464-
1465-
// Reply with a body, file attachment, item attachment, and a callback.
1466-
1467-
Office.context.mailbox.item.displayReplyAllForm(
1468-
1469-
{
1470-
'htmlBody' : 'hi',
1471-
'attachments' :
1472-
[
1473-
{
1474-
'type' : Office.MailboxEnums.AttachmentType.File,
1475-
'name' : 'squirrel.png',
1476-
'url' : 'http://i.imgur.com/sRgTlGR.jpg'
1477-
},
1478-
{
1479-
'type' : 'item',
1480-
'name' : 'rand',
1481-
'itemId' : Office.context.mailbox.item.itemId
1482-
}
1483-
],
1484-
'callback' : function(asyncResult)
1485-
{
1486-
console.log(asyncResult.value);
1487-
}
1488-
});
1489-
1490-
```
1491-
14921371
```TypeScript
14931372
14941373
// Link to full sample:
@@ -2358,52 +2237,6 @@ methods:
23582237
#### Examples
23592238
23602239
2361-
```TypeScript
2362-
2363-
// Consider an add-in manifest has the following `Rule` element:
2364-
2365-
//<Rule xsi:type="RuleCollection" Mode="And">
2366-
2367-
// <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
2368-
2369-
// <Rule xsi:type="RuleCollection" Mode="Or">
2370-
2371-
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="fruits" RegExValue="apple|banana|coconut"
2372-
PropertyName="BodyAsPlaintext" IgnoreCase="true" />
2373-
2374-
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="veggies"
2375-
RegExValue="tomato|onion|spinach|broccoli" PropertyName="BodyAsPlaintext" IgnoreCase="true" />
2376-
2377-
// </Rule>
2378-
2379-
//</Rule>
2380-
2381-
2382-
// The object returned from `getRegExMatches` would have two properties: `fruits` and `veggies`.
2383-
2384-
//{
2385-
2386-
//'fruits': ['apple','banana','Banana','coconut'],
2387-
2388-
//'veggies': ['tomato','onion','spinach','broccoli']
2389-
2390-
//}
2391-
2392-
2393-
// The following example shows how to access the array of
2394-
2395-
// matches for the regular expression rule elements `fruits`
2396-
2397-
// and `veggies`, which are specified in the manifest.
2398-
2399-
const allMatches = Office.context.mailbox.item.getRegExMatches();
2400-
2401-
const fruits = allMatches.fruits;
2402-
2403-
const veggies = allMatches.veggies;
2404-
2405-
```
2406-
24072240
```TypeScript
24082241
24092242
// Link to full sample:
@@ -2477,44 +2310,6 @@ methods:
24772310
#### Examples
24782311
24792312
2480-
```TypeScript
2481-
2482-
// Consider an add-in manifest has the following `Rule` element:
2483-
2484-
//<Rule xsi:type="RuleCollection" Mode="And">
2485-
2486-
// <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
2487-
2488-
// <Rule xsi:type="RuleCollection" Mode="Or">
2489-
2490-
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="fruits" RegExValue="apple|banana|coconut"
2491-
PropertyName="BodyAsPlaintext" IgnoreCase="true" />
2492-
2493-
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="veggies"
2494-
RegExValue="tomato|onion|spinach|broccoli" PropertyName="BodyAsPlaintext" IgnoreCase="true" />
2495-
2496-
// </Rule>
2497-
2498-
//</Rule>
2499-
2500-
2501-
// The object returned from `getRegExMatches` would have two properties: `fruits` and `veggies`.
2502-
2503-
//{
2504-
2505-
//'fruits': ['apple','banana','Banana','coconut'],
2506-
2507-
//'veggies': ['tomato','onion','spinach','broccoli']
2508-
2509-
//}
2510-
2511-
2512-
const fruits = Office.context.mailbox.item.getRegExMatchesByName("fruits");
2513-
2514-
const veggies = Office.context.mailbox.item.getRegExMatchesByName("veggies");
2515-
2516-
```
2517-
25182313
```TypeScript
25192314
25202315
// Link to full sample:
@@ -2625,52 +2420,6 @@ methods:
26252420
#### Examples
26262421
26272422
2628-
```TypeScript
2629-
2630-
// Consider an add-in manifest has the following `Rule` element:
2631-
2632-
//<Rule xsi:type="RuleCollection" Mode="And">
2633-
2634-
// <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
2635-
2636-
// <Rule xsi:type="RuleCollection" Mode="Or">
2637-
2638-
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="fruits" RegExValue="apple|banana|coconut"
2639-
PropertyName="BodyAsPlaintext" IgnoreCase="true" />
2640-
2641-
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="veggies"
2642-
RegExValue="tomato|onion|spinach|broccoli" PropertyName="BodyAsPlaintext" IgnoreCase="true" />
2643-
2644-
// </Rule>
2645-
2646-
//</Rule>
2647-
2648-
2649-
// The object returned from `getRegExMatches` would have two properties: `fruits` and `veggies`.
2650-
2651-
//{
2652-
2653-
//'fruits': ['apple','banana','Banana','coconut'],
2654-
2655-
//'veggies': ['tomato','onion','spinach','broccoli']
2656-
2657-
//}
2658-
2659-
2660-
// The following example shows how to access the array of matches for the
2661-
2662-
// regular expression rule elements `fruits` and `veggies`, which are
2663-
2664-
// specified in the manifest.
2665-
2666-
const selectedMatches = Office.context.mailbox.item.getSelectedRegExMatches();
2667-
2668-
const fruits = selectedMatches.fruits;
2669-
2670-
const veggies = selectedMatches.veggies;
2671-
2672-
```
2673-
26742423
```TypeScript
26752424
26762425
// Link to full sample:

0 commit comments

Comments
 (0)