Skip to content

Commit 604b33e

Browse files
[All hosts] Get latest (#2439)
1 parent f2235bd commit 604b33e

File tree

10 files changed

+284
-3
lines changed

10 files changed

+284
-3
lines changed

docs/docs-ref-autogen/office/office/office.slice.yml

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,95 @@ fullName: Office.Slice
66
summary: >-
77
Represents a slice of a document file. The Slice object is accessed with the
88
`File.getSliceAsync` method.
9-
remarks: ''
9+
remarks: >-
10+
11+
12+
#### Examples
13+
14+
15+
```TypeScript
16+
17+
// This example demonstrates how to read file slices using the Office.Slice
18+
interface.
19+
20+
// Each slice represents a portion of the document file and includes the
21+
data,
22+
23+
// index, and size properties.
24+
25+
Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize:
26+
65536 },
27+
function (result) {
28+
if (result.status === Office.AsyncResultStatus.Succeeded) {
29+
const file = result.value;
30+
const sliceCount = file.sliceCount;
31+
let slicesReceived = 0;
32+
let fileData = [];
33+
34+
console.log(`File sliced into ${sliceCount} parts.`);
35+
36+
// Get the first slice.
37+
getSliceAsync(file, 0, sliceCount);
38+
39+
/**
40+
* Recursively retrieves slices from the file.
41+
* @param file - The Office.File object to retrieve slices from.
42+
* @param sliceIndex - The zero-based index of the slice to retrieve.
43+
* @param totalSlices - The total number of slices in the file.
44+
*/
45+
function getSliceAsync(file, sliceIndex, totalSlices) {
46+
file.getSliceAsync(sliceIndex, function (sliceResult) {
47+
if (sliceResult.status === Office.AsyncResultStatus.Succeeded) {
48+
const slice: Office.Slice = sliceResult.value;
49+
50+
// Access the properties of the Slice.
51+
console.log(`Processing slice ${slice.index + 1} of ${totalSlices}`);
52+
console.log(`Slice size: ${slice.size} bytes`);
53+
54+
// Store the slice data.
55+
fileData[slice.index] = slice.data;
56+
slicesReceived++;
57+
58+
// Check if we've received all slices.
59+
if (slicesReceived === totalSlices) {
60+
file.closeAsync();
61+
console.log("All slices received. File data complete.");
62+
63+
// Process the complete file data.
64+
processFileData(fileData);
65+
} else {
66+
// Get the next slice.
67+
getSliceAsync(file, sliceIndex + 1, totalSlices);
68+
}
69+
} else {
70+
file.closeAsync();
71+
console.error(`Error getting slice: ${sliceResult.error.message}`);
72+
}
73+
});
74+
}
75+
76+
/**
77+
* Processes the complete file data by combining all slices.
78+
* @param data - An array of slice data arrays to combine.
79+
*/
80+
function processFileData(data) {
81+
// Combine all slice data into a complete file.
82+
let combinedData = [];
83+
for (let i = 0; i < data.length; i++) {
84+
combinedData.push(...data[i]);
85+
}
86+
87+
console.log(`File processing complete. Total bytes: ${combinedData.length}`);
88+
// At this point, combinedData contains the complete file content.
89+
// You can now save it, send it to a server, or process it further.
90+
}
91+
} else {
92+
console.error(`Error getting file: ${result.error.message}`);
93+
}
94+
}
95+
);
96+
97+
```
1098
1199
isPreview: false
12100
isDeprecated: false

docs/docs-ref-autogen/office_release/office/office.slice.yml

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,95 @@ fullName: Office.Slice
66
summary: >-
77
Represents a slice of a document file. The Slice object is accessed with the
88
`File.getSliceAsync` method.
9-
remarks: ''
9+
remarks: >-
10+
11+
12+
#### Examples
13+
14+
15+
```TypeScript
16+
17+
// This example demonstrates how to read file slices using the Office.Slice
18+
interface.
19+
20+
// Each slice represents a portion of the document file and includes the
21+
data,
22+
23+
// index, and size properties.
24+
25+
Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize:
26+
65536 },
27+
function (result) {
28+
if (result.status === Office.AsyncResultStatus.Succeeded) {
29+
const file = result.value;
30+
const sliceCount = file.sliceCount;
31+
let slicesReceived = 0;
32+
let fileData = [];
33+
34+
console.log(`File sliced into ${sliceCount} parts.`);
35+
36+
// Get the first slice.
37+
getSliceAsync(file, 0, sliceCount);
38+
39+
/**
40+
* Recursively retrieves slices from the file.
41+
* @param file - The Office.File object to retrieve slices from.
42+
* @param sliceIndex - The zero-based index of the slice to retrieve.
43+
* @param totalSlices - The total number of slices in the file.
44+
*/
45+
function getSliceAsync(file, sliceIndex, totalSlices) {
46+
file.getSliceAsync(sliceIndex, function (sliceResult) {
47+
if (sliceResult.status === Office.AsyncResultStatus.Succeeded) {
48+
const slice: Office.Slice = sliceResult.value;
49+
50+
// Access the properties of the Slice.
51+
console.log(`Processing slice ${slice.index + 1} of ${totalSlices}`);
52+
console.log(`Slice size: ${slice.size} bytes`);
53+
54+
// Store the slice data.
55+
fileData[slice.index] = slice.data;
56+
slicesReceived++;
57+
58+
// Check if we've received all slices.
59+
if (slicesReceived === totalSlices) {
60+
file.closeAsync();
61+
console.log("All slices received. File data complete.");
62+
63+
// Process the complete file data.
64+
processFileData(fileData);
65+
} else {
66+
// Get the next slice.
67+
getSliceAsync(file, sliceIndex + 1, totalSlices);
68+
}
69+
} else {
70+
file.closeAsync();
71+
console.error(`Error getting slice: ${sliceResult.error.message}`);
72+
}
73+
});
74+
}
75+
76+
/**
77+
* Processes the complete file data by combining all slices.
78+
* @param data - An array of slice data arrays to combine.
79+
*/
80+
function processFileData(data) {
81+
// Combine all slice data into a complete file.
82+
let combinedData = [];
83+
for (let i = 0; i < data.length; i++) {
84+
combinedData.push(...data[i]);
85+
}
86+
87+
console.log(`File processing complete. Total bytes: ${combinedData.length}`);
88+
// At this point, combinedData contains the complete file content.
89+
// You can now save it, send it to a server, or process it further.
90+
}
91+
} else {
92+
console.error(`Error getting file: ${result.error.message}`);
93+
}
94+
}
95+
);
96+
97+
```
1098
1199
isPreview: false
12100
isDeprecated: false

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ properties:
409409
**Important**
410410
411411
412+
- The `errorMessageMarkdown` property is available for preview in Outlook
413+
on Mac starting in Version 16.103 (Build 25102433). To test the property,
414+
join the [Microsoft 365 Insider
415+
program](https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756)
416+
and select the **Beta Channel** option to access Office beta builds.
417+
418+
412419
- The formatted error message must be 500 characters or less.
413420
414421

docs/docs-ref-autogen/outlook_1_15/outlook/office.smartalertseventcompletedoptions.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ properties:
409409
**Important**
410410
411411
412+
- The `errorMessageMarkdown` property is available for preview in Outlook
413+
on Mac starting in Version 16.103 (Build 25102433). To test the property,
414+
join the [Microsoft 365 Insider
415+
program](https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756)
416+
and select the **Beta Channel** option to access Office beta builds.
417+
418+
412419
- The formatted error message must be 500 characters or less.
413420
414421

generate-docs/API Coverage Report.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8109,7 +8109,7 @@ office,Office.Settings,"set(name, value)",Method,Excellent,true
81098109
office,Office.SettingsChangedEventArgs,N/A,Interface,Excellent,false
81108110
office,Office.SettingsChangedEventArgs,"settings",Property,Good,false
81118111
office,Office.SettingsChangedEventArgs,"type",Property,Great,false
8112-
office,Office.Slice,N/A,Interface,Great,false
8112+
office,Office.Slice,N/A,Interface,Great,true
81138113
office,Office.Slice,"data",Property,Excellent,false
81148114
office,Office.Slice,"index",Property,Poor,false
81158115
office,Office.Slice,"size",Property,Poor,false

generate-docs/api-extractor-inputs-outlook-release/Outlook_1_15/outlook.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14943,6 +14943,10 @@ export declare namespace Office {
1494314943
*
1494414944
* **Important**
1494514945
*
14946+
* - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the
14947+
* {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and
14948+
* select the **Beta Channel** option to access Office beta builds.
14949+
*
1494614950
* - The formatted error message must be 500 characters or less.
1494714951
*
1494814952
* - For guidance on supported Markdown elements, see

generate-docs/api-extractor-inputs-outlook/outlook.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15712,6 +15712,10 @@ export declare namespace Office {
1571215712
*
1571315713
* **Important**
1571415714
*
15715+
* - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the
15716+
* {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and
15717+
* select the **Beta Channel** option to access Office beta builds.
15718+
*
1571515719
* - The formatted error message must be 500 characters or less.
1571615720
*
1571715721
* - For guidance on supported Markdown elements, see

generate-docs/script-inputs/local-repo-snippets.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5971,6 +5971,81 @@ Office.Settings#saveAsync:member(2):
59715971
function write(message){
59725972
document.getElementById('message').innerText += message;
59735973
}
5974+
Office.Slice:interface:
5975+
- |-
5976+
// This example demonstrates how to read file slices using the Office.Slice interface.
5977+
// Each slice represents a portion of the document file and includes the data,
5978+
// index, and size properties.
5979+
Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize: 65536 },
5980+
function (result) {
5981+
if (result.status === Office.AsyncResultStatus.Succeeded) {
5982+
const file = result.value;
5983+
const sliceCount = file.sliceCount;
5984+
let slicesReceived = 0;
5985+
let fileData = [];
5986+
5987+
console.log(`File sliced into ${sliceCount} parts.`);
5988+
5989+
// Get the first slice.
5990+
getSliceAsync(file, 0, sliceCount);
5991+
5992+
/**
5993+
* Recursively retrieves slices from the file.
5994+
* @param file - The Office.File object to retrieve slices from.
5995+
* @param sliceIndex - The zero-based index of the slice to retrieve.
5996+
* @param totalSlices - The total number of slices in the file.
5997+
*/
5998+
function getSliceAsync(file, sliceIndex, totalSlices) {
5999+
file.getSliceAsync(sliceIndex, function (sliceResult) {
6000+
if (sliceResult.status === Office.AsyncResultStatus.Succeeded) {
6001+
const slice: Office.Slice = sliceResult.value;
6002+
6003+
// Access the properties of the Slice.
6004+
console.log(`Processing slice ${slice.index + 1} of ${totalSlices}`);
6005+
console.log(`Slice size: ${slice.size} bytes`);
6006+
6007+
// Store the slice data.
6008+
fileData[slice.index] = slice.data;
6009+
slicesReceived++;
6010+
6011+
// Check if we've received all slices.
6012+
if (slicesReceived === totalSlices) {
6013+
file.closeAsync();
6014+
console.log("All slices received. File data complete.");
6015+
6016+
// Process the complete file data.
6017+
processFileData(fileData);
6018+
} else {
6019+
// Get the next slice.
6020+
getSliceAsync(file, sliceIndex + 1, totalSlices);
6021+
}
6022+
} else {
6023+
file.closeAsync();
6024+
console.error(`Error getting slice: ${sliceResult.error.message}`);
6025+
}
6026+
});
6027+
}
6028+
6029+
/**
6030+
* Processes the complete file data by combining all slices.
6031+
* @param data - An array of slice data arrays to combine.
6032+
*/
6033+
function processFileData(data) {
6034+
// Combine all slice data into a complete file.
6035+
let combinedData = [];
6036+
for (let i = 0; i < data.length; i++) {
6037+
combinedData.push(...data[i]);
6038+
}
6039+
6040+
console.log(`File processing complete. Total bytes: ${combinedData.length}`);
6041+
// At this point, combinedData contains the complete file content.
6042+
// You can now save it, send it to a server, or process it further.
6043+
}
6044+
} else {
6045+
console.error(`Error getting file: ${result.error.message}`);
6046+
}
6047+
}
6048+
);
59746049
Office.StartupBehavior:enum:
59756050
- |-
59766051
// Configure your add-in to load and start running when the document is opened.

generate-docs/script-inputs/office.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23846,6 +23846,10 @@ declare namespace Office {
2384623846
*
2384723847
* **Important**
2384823848
*
23849+
* - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the
23850+
* {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and
23851+
* select the **Beta Channel** option to access Office beta builds.
23852+
*
2384923853
* - The formatted error message must be 500 characters or less.
2385023854
*
2385123855
* - For guidance on supported Markdown elements, see

generate-docs/script-inputs/office_preview.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24625,6 +24625,10 @@ declare namespace Office {
2462524625
*
2462624626
* **Important**
2462724627
*
24628+
* - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the
24629+
* {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and
24630+
* select the **Beta Channel** option to access Office beta builds.
24631+
*
2462824632
* - The formatted error message must be 500 characters or less.
2462924633
*
2463024634
* - For guidance on supported Markdown elements, see

0 commit comments

Comments
 (0)