NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PowerPoint.ReadOnlyRecommended missing

robertmuehsig opened this issue · comments

This property is missing in NetOffice: Presentation.ReadOnlyRecommended

https://learn.microsoft.com/en-us/office/vba/api/powerpoint.presentation.readonlyrecommended

It seems this thing came with Office 2019 (e.g. see the OpenXml Remarks.

As a workaround I used this:

 try
 {
     // OfficeInstance == Presentation
     bool isReadOnlyRecommended = OfficeInstance.Property<bool>("ReadOnlyRecommended");
     if (isReadOnlyRecommended)
     {
         return true;
     }
 }
 catch (PropertyGetCOMException)
 {
     // ignore, might happen on pre Office 2019 versions
 }

If you wonder where to enable this - here:

image