Closed kodefile closed 3 months ago
Thank you for reporting this issue. The limitation towards file size is by designed according to consideration on server's load and others. So we will not fix it in short term. We recommend you to submit a new Tech Community New Ideas Item which will give us visibility of the commonality of it (You can submit on https://aka.ms/m365dev-suggestions).
Thank you for reporting this issue. The limitation towards file size is by designed according to consideration on server's load and others. So we will not fix it in short term. We recommend you to submit a new Tech Community New Ideas Item which will give us visibility of the commonality of it (You can submit on https://aka.ms/m365dev-suggestions).
Thanks for your feedback on this issue but I am not sure I understand the issue about server load because I can add multiple CustomXML Parts each of size 1MB. I have successfully added 27 CustomXML Parts, each 1MB, in a single file. So the aggregate size of the custom xml is 27MBs. The CustomXML Part size limitation wouldn't be an effective way of limiting server loads.
The Size Limit on the Web create a more significant problem as described below:
If I use Office on the Desktop and add a large (> 1MB) customxml part and save the document, I can then open the document using Office on the Web without any errors. However, when I attempt to read the customxml part on Office on the Web, the application returns an error indicating that the CustomXML Part was NOT FOUND.
This error is indistinguishable from a case where the CustomXML Part is actually missing and there is no way to disambiguate the errors. In addition, Office on the Web and Office on the Desktop should allow opening and accessing parts of the file in a consistent manner regardless of what platform they were created on (desktop or web). So I can understand limiting ADDING CustomXML Part for Office on the Web to 1MB but READING the CustomXML Part should NOT be subject to the same limitation. If this limitation must be present, then an unambiguous error message should be returned.
I would appreciate your thoughts on this issue and look forward to hearing from you.
Thank you.
@kodefile , thanks a lot for your feedback. All of your findings and insights mean a lot to us.
Given some existing limitation and consideration, the current implementation might not be the best option. A serious discussion had been held between related teams. A work item 5794915 is now logged. The priority and/or efforts will be evaluated and planned along with other work items. This might not be resolved in a short time, but I'm sure it will be carefully tracked.
One more to confirm with you:
How did you get the following error?
"the application returns an error indicating that the CustomXML Part was NOT FOUND."
Thanks again. Your help are greatly appreciated.
Greatly appreciate you looking into this issue. To get the error referenced above, I used Word on Desktop to add a CustomXML part that was 2MB to a document and saved it. I then used Word on the Web to open the document and attempted to retrieve the custom xml part using Office.context.document.customXmlParts.getByIdAsync(id, callback). This method returned an Office.AsyncResult object containing an error indicating that the Custom XML Part was not found. Specifically, the error object contains: Error Code: 6000 Error Name: Invalid Node Error Message: The specified node was not found.
To demonstrate this problem, I have created 2 scripts.
To add the custom xml part on Word on Desktop: https://gist.github.com/kodefile/3b4ab5229e2df22d3147e10a21e08651. Using this script on Word on Web will Fail to add the custom xml part because it exceeds the 1MB limit.
To read the custom xml part on either Word on Web or Word on Desktop: https://gist.github.com/kodefile/ffd7b7b28be7600c0621129cfe88630a. The custom xml part ID is hard coded in this script. This script is only meant to be used specifically with the demo file attached below.
Demo docx CustomXMLDemo.docx. This file contains a single custom xml part (2MB) which was added using the first script mentioned above.
If you open the file on Word on Desktop and run the second script to read the custom xml part, you will get a message indicating that the custom xml part was retrieved successfully as illustrated in this screenshot
If you open the file on Word on the Web and use the second script to attempt to get the custom xml part. This will print out the error message on the console.
NOTE: I have hard-coded the Custom XML Part ID in the script for simplicity. Make sure to update it if you edit/recreate the custom xml part.
Provide required information needed to triage your issue
I have written an add-in for Word that stores some data as a custom xml part. When the add-in runs on the Desktop for both Windows 11 and MacOS, I can insert custom xml parts larger than 7MB. However, when the same add-in runs on the web (I have tested this for Edge, Chrome and Firefox on Windows 11), I am unable to add any custom XML part where the XML String is larger than precisely 1MB . Office.context.document.customXmlParts.addAsync returns an error code 6100 with the message Custom XML Error for anything larger than 1MB.
Your Environment
Expected behavior
When inserting a Custom XML Part that is larger than 1MB, I expected Office.context.document.customXmlParts.addAsync to return a Office.AsyncResult result object with the value = CustomXMLPart that was added. This is the case with the Add-in on Word on Desktop (Windows 11)
Current behavior
When inserting a Custom XML Part that is larger than 1MB, Office.context.document.customXmlParts.addAsync returns a Office.AsyncResult result object with an error with code 6100 and message CustomXML Error
This inconsistency between the Desktop version and the Web Version makes it difficult to create a plugin that will offer consistent behavior and functionality across platforms. Is there any reason this limit exists for the Web Version but NOT the Desktop version?
Steps to reproduce
Link to live example(s)
Context
This issue prevents us from developing an add-in where data can be stored in custom xml parts consistently across platforms.