OneNote Interop API UpdatePageContent changes lastModifiedTime of unmodified child elements
C# with .NET Framework 4.8, OneNote 16.0.15726.20188 64-bit
Using the Interop API, IApplication.UpdatePageContent(xml, lastModTime, XMLSchema.xs2013, true)
Given a page with one Outline and two OE paragraphs where each OE paragraph was contributed by different authors on different dates.
If any change is made to the Outline, such as appending a new OE, without modifying the existing OEs, then when the page is saved using UpdatePageContent, the lastModifiedTime attribute of all descendants of that Outline are updated to the current time. This results in losing information regarding when a particular author applied their changes.
The expectation is that the EditedByAttributes (per 0336.OneNoteApplication_2013.xsd) of an OE should be preserved unless that OE's content has changed.
Users who share notebooks often rely on the EditedByAttributes (who and when) for individual parts of a page to track independent changes. The current behavior loses that auditing capability.
Note that this usage is based on https://learn.microsoft.com/en-us/office/client-developer/onenote/application-interface-onenote#updatepagecontent-method which explains:
- You must include page-level objects in the UpdatePageContent call
- The dateExpectedLastModified is nothing more than a pessimistic locking type of safe-guard and is not considered in any regard in relation to the lastModifiedTime attribute