0
votes

I have an Excel XLL which uses Excel Interop and I use customDocumentProperties to store some settings for the workbook. The C# code looks like:

var customDocumentProperties = Workbook.CustomDocumentProperties;
customDocumentProperties.Add("MyData", false, Microsoft.Office.Core.MsoDocProperties.msoPropertyTypeString, "mysettings");

Now I am trying to create an Office add-in (excel task-pane) with Office.js and the equivalent way to store custom data is using Office.context.document.settings. So javascript code looks something like:

Office.context.document.settings.set("MyData", "mysettings");

However, these two methods are incompatible. ie. if I set the property with the the XLL, I can not read it with the Office add-in and vice versa.

Is there anyway to create compatible custom document properties that can be used in both Excel 2016 (through xll c# or vba) and Office 365 Excel?

Thanks in advance, Jon

1
Did you figure out a way to set custom properties in Office 365? - Mhd
The second method above (Office.context.document.settings.set) works in Office 365 using Office.js. It just isn't compatible with Excel 2016 (method #1 which is the older method). - JL8707

1 Answers

2
votes

No, it is not currently possible. You may be able to inspect the OOXML format of the Word document to figure out where the Office add-in settings live, but there's no official path.

We do have adding custom document properties / custom XML parts on our backlog...

~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT