diff --git a/docs/docs-ref-autogen/office/office/office.slice.yml b/docs/docs-ref-autogen/office/office/office.slice.yml index 2330878763..d4ed37fd7c 100644 --- a/docs/docs-ref-autogen/office/office/office.slice.yml +++ b/docs/docs-ref-autogen/office/office/office.slice.yml @@ -6,7 +6,95 @@ fullName: Office.Slice summary: >- Represents a slice of a document file. The Slice object is accessed with the `File.getSliceAsync` method. -remarks: '' +remarks: >- + + + #### Examples + + + ```TypeScript + + // This example demonstrates how to read file slices using the Office.Slice + interface. + + // Each slice represents a portion of the document file and includes the + data, + + // index, and size properties. + + Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize: + 65536 }, + function (result) { + if (result.status === Office.AsyncResultStatus.Succeeded) { + const file = result.value; + const sliceCount = file.sliceCount; + let slicesReceived = 0; + let fileData = []; + + console.log(`File sliced into ${sliceCount} parts.`); + + // Get the first slice. + getSliceAsync(file, 0, sliceCount); + + /** + * Recursively retrieves slices from the file. + * @param file - The Office.File object to retrieve slices from. + * @param sliceIndex - The zero-based index of the slice to retrieve. + * @param totalSlices - The total number of slices in the file. + */ + function getSliceAsync(file, sliceIndex, totalSlices) { + file.getSliceAsync(sliceIndex, function (sliceResult) { + if (sliceResult.status === Office.AsyncResultStatus.Succeeded) { + const slice: Office.Slice = sliceResult.value; + + // Access the properties of the Slice. + console.log(`Processing slice ${slice.index + 1} of ${totalSlices}`); + console.log(`Slice size: ${slice.size} bytes`); + + // Store the slice data. + fileData[slice.index] = slice.data; + slicesReceived++; + + // Check if we've received all slices. + if (slicesReceived === totalSlices) { + file.closeAsync(); + console.log("All slices received. File data complete."); + + // Process the complete file data. + processFileData(fileData); + } else { + // Get the next slice. + getSliceAsync(file, sliceIndex + 1, totalSlices); + } + } else { + file.closeAsync(); + console.error(`Error getting slice: ${sliceResult.error.message}`); + } + }); + } + + /** + * Processes the complete file data by combining all slices. + * @param data - An array of slice data arrays to combine. + */ + function processFileData(data) { + // Combine all slice data into a complete file. + let combinedData = []; + for (let i = 0; i < data.length; i++) { + combinedData.push(...data[i]); + } + + console.log(`File processing complete. Total bytes: ${combinedData.length}`); + // At this point, combinedData contains the complete file content. + // You can now save it, send it to a server, or process it further. + } + } else { + console.error(`Error getting file: ${result.error.message}`); + } + } + ); + + ``` isPreview: false isDeprecated: false diff --git a/docs/docs-ref-autogen/office_release/office/office.slice.yml b/docs/docs-ref-autogen/office_release/office/office.slice.yml index 2330878763..d4ed37fd7c 100644 --- a/docs/docs-ref-autogen/office_release/office/office.slice.yml +++ b/docs/docs-ref-autogen/office_release/office/office.slice.yml @@ -6,7 +6,95 @@ fullName: Office.Slice summary: >- Represents a slice of a document file. The Slice object is accessed with the `File.getSliceAsync` method. -remarks: '' +remarks: >- + + + #### Examples + + + ```TypeScript + + // This example demonstrates how to read file slices using the Office.Slice + interface. + + // Each slice represents a portion of the document file and includes the + data, + + // index, and size properties. + + Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize: + 65536 }, + function (result) { + if (result.status === Office.AsyncResultStatus.Succeeded) { + const file = result.value; + const sliceCount = file.sliceCount; + let slicesReceived = 0; + let fileData = []; + + console.log(`File sliced into ${sliceCount} parts.`); + + // Get the first slice. + getSliceAsync(file, 0, sliceCount); + + /** + * Recursively retrieves slices from the file. + * @param file - The Office.File object to retrieve slices from. + * @param sliceIndex - The zero-based index of the slice to retrieve. + * @param totalSlices - The total number of slices in the file. + */ + function getSliceAsync(file, sliceIndex, totalSlices) { + file.getSliceAsync(sliceIndex, function (sliceResult) { + if (sliceResult.status === Office.AsyncResultStatus.Succeeded) { + const slice: Office.Slice = sliceResult.value; + + // Access the properties of the Slice. + console.log(`Processing slice ${slice.index + 1} of ${totalSlices}`); + console.log(`Slice size: ${slice.size} bytes`); + + // Store the slice data. + fileData[slice.index] = slice.data; + slicesReceived++; + + // Check if we've received all slices. + if (slicesReceived === totalSlices) { + file.closeAsync(); + console.log("All slices received. File data complete."); + + // Process the complete file data. + processFileData(fileData); + } else { + // Get the next slice. + getSliceAsync(file, sliceIndex + 1, totalSlices); + } + } else { + file.closeAsync(); + console.error(`Error getting slice: ${sliceResult.error.message}`); + } + }); + } + + /** + * Processes the complete file data by combining all slices. + * @param data - An array of slice data arrays to combine. + */ + function processFileData(data) { + // Combine all slice data into a complete file. + let combinedData = []; + for (let i = 0; i < data.length; i++) { + combinedData.push(...data[i]); + } + + console.log(`File processing complete. Total bytes: ${combinedData.length}`); + // At this point, combinedData contains the complete file content. + // You can now save it, send it to a server, or process it further. + } + } else { + console.error(`Error getting file: ${result.error.message}`); + } + } + ); + + ``` isPreview: false isDeprecated: false diff --git a/docs/docs-ref-autogen/outlook/outlook/office.smartalertseventcompletedoptions.yml b/docs/docs-ref-autogen/outlook/outlook/office.smartalertseventcompletedoptions.yml index f0cb695da6..d154c75985 100644 --- a/docs/docs-ref-autogen/outlook/outlook/office.smartalertseventcompletedoptions.yml +++ b/docs/docs-ref-autogen/outlook/outlook/office.smartalertseventcompletedoptions.yml @@ -409,6 +409,13 @@ properties: **Important** + - The `errorMessageMarkdown` property is available for preview in Outlook + on Mac starting in Version 16.103 (Build 25102433). To test the property, + join the [Microsoft 365 Insider + program](https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756) + and select the **Beta Channel** option to access Office beta builds. + + - The formatted error message must be 500 characters or less. diff --git a/docs/docs-ref-autogen/outlook_1_15/outlook/office.smartalertseventcompletedoptions.yml b/docs/docs-ref-autogen/outlook_1_15/outlook/office.smartalertseventcompletedoptions.yml index a7e692dfbc..f57b732f6a 100644 --- a/docs/docs-ref-autogen/outlook_1_15/outlook/office.smartalertseventcompletedoptions.yml +++ b/docs/docs-ref-autogen/outlook_1_15/outlook/office.smartalertseventcompletedoptions.yml @@ -409,6 +409,13 @@ properties: **Important** + - The `errorMessageMarkdown` property is available for preview in Outlook + on Mac starting in Version 16.103 (Build 25102433). To test the property, + join the [Microsoft 365 Insider + program](https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756) + and select the **Beta Channel** option to access Office beta builds. + + - The formatted error message must be 500 characters or less. diff --git a/generate-docs/API Coverage Report.csv b/generate-docs/API Coverage Report.csv index 1d572ed53a..8bcc91590b 100644 --- a/generate-docs/API Coverage Report.csv +++ b/generate-docs/API Coverage Report.csv @@ -8109,7 +8109,7 @@ office,Office.Settings,"set(name, value)",Method,Excellent,true office,Office.SettingsChangedEventArgs,N/A,Interface,Excellent,false office,Office.SettingsChangedEventArgs,"settings",Property,Good,false office,Office.SettingsChangedEventArgs,"type",Property,Great,false -office,Office.Slice,N/A,Interface,Great,false +office,Office.Slice,N/A,Interface,Great,true office,Office.Slice,"data",Property,Excellent,false office,Office.Slice,"index",Property,Poor,false office,Office.Slice,"size",Property,Poor,false diff --git a/generate-docs/api-extractor-inputs-outlook-release/Outlook_1_15/outlook.d.ts b/generate-docs/api-extractor-inputs-outlook-release/Outlook_1_15/outlook.d.ts index 48848f30d9..f3842907db 100644 --- a/generate-docs/api-extractor-inputs-outlook-release/Outlook_1_15/outlook.d.ts +++ b/generate-docs/api-extractor-inputs-outlook-release/Outlook_1_15/outlook.d.ts @@ -14943,6 +14943,10 @@ export declare namespace Office { * * **Important** * + * - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the + * {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and + * select the **Beta Channel** option to access Office beta builds. + * * - The formatted error message must be 500 characters or less. * * - For guidance on supported Markdown elements, see diff --git a/generate-docs/api-extractor-inputs-outlook/outlook.d.ts b/generate-docs/api-extractor-inputs-outlook/outlook.d.ts index 381f4eeb16..2457b0ea98 100644 --- a/generate-docs/api-extractor-inputs-outlook/outlook.d.ts +++ b/generate-docs/api-extractor-inputs-outlook/outlook.d.ts @@ -15712,6 +15712,10 @@ export declare namespace Office { * * **Important** * + * - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the + * {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and + * select the **Beta Channel** option to access Office beta builds. + * * - The formatted error message must be 500 characters or less. * * - For guidance on supported Markdown elements, see diff --git a/generate-docs/script-inputs/local-repo-snippets.yaml b/generate-docs/script-inputs/local-repo-snippets.yaml index 0fc06f7e35..0318ed4a2d 100644 --- a/generate-docs/script-inputs/local-repo-snippets.yaml +++ b/generate-docs/script-inputs/local-repo-snippets.yaml @@ -5971,6 +5971,81 @@ Office.Settings#saveAsync:member(2): function write(message){ document.getElementById('message').innerText += message; } +Office.Slice:interface: + - |- + // This example demonstrates how to read file slices using the Office.Slice interface. + // Each slice represents a portion of the document file and includes the data, + // index, and size properties. + Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize: 65536 }, + function (result) { + if (result.status === Office.AsyncResultStatus.Succeeded) { + const file = result.value; + const sliceCount = file.sliceCount; + let slicesReceived = 0; + let fileData = []; + + console.log(`File sliced into ${sliceCount} parts.`); + + // Get the first slice. + getSliceAsync(file, 0, sliceCount); + + /** + * Recursively retrieves slices from the file. + * @param file - The Office.File object to retrieve slices from. + * @param sliceIndex - The zero-based index of the slice to retrieve. + * @param totalSlices - The total number of slices in the file. + */ + function getSliceAsync(file, sliceIndex, totalSlices) { + file.getSliceAsync(sliceIndex, function (sliceResult) { + if (sliceResult.status === Office.AsyncResultStatus.Succeeded) { + const slice: Office.Slice = sliceResult.value; + + // Access the properties of the Slice. + console.log(`Processing slice ${slice.index + 1} of ${totalSlices}`); + console.log(`Slice size: ${slice.size} bytes`); + + // Store the slice data. + fileData[slice.index] = slice.data; + slicesReceived++; + + // Check if we've received all slices. + if (slicesReceived === totalSlices) { + file.closeAsync(); + console.log("All slices received. File data complete."); + + // Process the complete file data. + processFileData(fileData); + } else { + // Get the next slice. + getSliceAsync(file, sliceIndex + 1, totalSlices); + } + } else { + file.closeAsync(); + console.error(`Error getting slice: ${sliceResult.error.message}`); + } + }); + } + + /** + * Processes the complete file data by combining all slices. + * @param data - An array of slice data arrays to combine. + */ + function processFileData(data) { + // Combine all slice data into a complete file. + let combinedData = []; + for (let i = 0; i < data.length; i++) { + combinedData.push(...data[i]); + } + + console.log(`File processing complete. Total bytes: ${combinedData.length}`); + // At this point, combinedData contains the complete file content. + // You can now save it, send it to a server, or process it further. + } + } else { + console.error(`Error getting file: ${result.error.message}`); + } + } + ); Office.StartupBehavior:enum: - |- // Configure your add-in to load and start running when the document is opened. diff --git a/generate-docs/script-inputs/office.d.ts b/generate-docs/script-inputs/office.d.ts index 3cc34e1c59..55b14b089f 100644 --- a/generate-docs/script-inputs/office.d.ts +++ b/generate-docs/script-inputs/office.d.ts @@ -23846,6 +23846,10 @@ declare namespace Office { * * **Important** * + * - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the + * {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and + * select the **Beta Channel** option to access Office beta builds. + * * - The formatted error message must be 500 characters or less. * * - For guidance on supported Markdown elements, see diff --git a/generate-docs/script-inputs/office_preview.d.ts b/generate-docs/script-inputs/office_preview.d.ts index 527056a233..edcc9efabe 100644 --- a/generate-docs/script-inputs/office_preview.d.ts +++ b/generate-docs/script-inputs/office_preview.d.ts @@ -24625,6 +24625,10 @@ declare namespace Office { * * **Important** * + * - The `errorMessageMarkdown` property is available for preview in Outlook on Mac starting in Version 16.103 (Build 25102433). To test the property, join the + * {@link https://techcommunity.microsoft.com/kb/microsoft-365-insider-kb/join-the-microsoft-365-insider-program-on-macos/4401756 | Microsoft 365 Insider program} and + * select the **Beta Channel** option to access Office beta builds. + * * - The formatted error message must be 500 characters or less. * * - For guidance on supported Markdown elements, see