From ca4937424b3736c19da1366b86a9aa5c46faeb6b Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Tue, 4 Nov 2025 22:01:35 +0100 Subject: [PATCH 1/6] Generate `SensitivityLabel` class with associated `LabelInfo` class --- Source/Office/DispatchInterfaces/LabelInfo.cs | 291 ++++++++++++++++++ .../DispatchInterfaces/SensitivityLabel.cs | 157 ++++++++++ Source/Office/Enums/MsoAssignmentMethod.cs | 45 +++ 3 files changed, 493 insertions(+) create mode 100644 Source/Office/DispatchInterfaces/LabelInfo.cs create mode 100644 Source/Office/DispatchInterfaces/SensitivityLabel.cs create mode 100644 Source/Office/Enums/MsoAssignmentMethod.cs diff --git a/Source/Office/DispatchInterfaces/LabelInfo.cs b/Source/Office/DispatchInterfaces/LabelInfo.cs new file mode 100644 index 000000000..6566bfd50 --- /dev/null +++ b/Source/Office/DispatchInterfaces/LabelInfo.cs @@ -0,0 +1,291 @@ +// Copyright 2025 Cisco Systems, Inc. All rights reserved. +// Licensed under MIT-style license (see LICENSE.txt file). +// +// Generated code file by Claude Haiku 4.5 +// + +using System; +using NetRuntimeSystem = System; +using System.ComponentModel; +using NetOffice.Attributes; + +namespace NetOffice.OfficeApi +{ + /// + /// DispatchInterface LabelInfo + /// SupportByVersion Office, 16 + /// + /// + /// Represents the label information data object. + /// The LabelInfo object can be passed to SetLabel method of SensitivityLabel object. + /// Docs: + /// + [SupportByVersion("Office", 16)] + [EntityType(EntityType.IsDispatchInterface)] + public class LabelInfo : _IMsoDispObj + { + #pragma warning disable + + #region Type Information + + /// + /// Instance Type + /// + [EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden] + public override Type InstanceType + { + get + { + return LateBindingApiWrapperType; + } + } + + private static Type _type; + + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public static Type LateBindingApiWrapperType + { + get + { + if (null == _type) + _type = typeof(LabelInfo); + return _type; + } + } + + #endregion + + #region Ctor + + /// current used factory core + /// object there has created the proxy + /// proxy share instead if com proxy + public LabelInfo(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare) + { + } + + ///current used factory core + ///object there has created the proxy + ///inner wrapped COM proxy + public LabelInfo(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy) + { + + } + + ///object there has created the proxy + ///inner wrapped COM proxy + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public LabelInfo(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy) + { + } + + ///current used factory core + ///object there has created the proxy + ///inner wrapped COM proxy + ///Type of inner wrapped COM proxy" + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public LabelInfo(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType) + { + + } + + ///object there has created the proxy + ///inner wrapped COM proxy + ///Type of inner wrapped COM proxy" + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public LabelInfo(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType) + { + } + + ///object to replaced. replacedObject are not usable after this action + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public LabelInfo(ICOMObject replacedObject) : base(replacedObject) + { + } + + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public LabelInfo() : base() + { + } + + /// registered progID + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public LabelInfo(string progId) : base(progId) + { + } + + #endregion + + #region Properties + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets the GUID that identifies the action to be performed. + [SupportByVersion("Office", 16)] + public string ActionId + { + get + { + return Factory.ExecuteStringPropertyGet(this, "ActionId"); + } + set + { + Factory.ExecuteValuePropertySet(this, "ActionId", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets how the label was assigned. + [SupportByVersion("Office", 16)] + public NetOffice.OfficeApi.Enums.MsoAssignmentMethod AssignmentMethod + { + get + { + return Factory.ExecuteEnumPropertyGet(this, "AssignmentMethod"); + } + set + { + Factory.ExecuteEnumPropertySet(this, "AssignmentMethod", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets content markings value. + [SupportByVersion("Office", 16)] + public Int32 ContentBits + { + get + { + return Factory.ExecuteInt32PropertyGet(this, "ContentBits"); + } + set + { + Factory.ExecuteValuePropertySet(this, "ContentBits", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets whether the label is enabled. + [SupportByVersion("Office", 16)] + public bool IsEnabled + { + get + { + return Factory.ExecuteBoolPropertyGet(this, "IsEnabled"); + } + set + { + Factory.ExecuteValuePropertySet(this, "IsEnabled", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets justification text. Required when downgrading labels. + [SupportByVersion("Office", 16)] + public string Justification + { + get + { + return Factory.ExecuteStringPropertyGet(this, "Justification"); + } + set + { + Factory.ExecuteValuePropertySet(this, "Justification", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets the GUID of the sensitivity label. + [SupportByVersion("Office", 16)] + public string LabelId + { + get + { + return Factory.ExecuteStringPropertyGet(this, "LabelId"); + } + set + { + Factory.ExecuteValuePropertySet(this, "LabelId", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets the display name of the label. + [SupportByVersion("Office", 16)] + public string LabelName + { + get + { + return Factory.ExecuteStringPropertyGet(this, "LabelName"); + } + set + { + Factory.ExecuteValuePropertySet(this, "LabelName", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets the date when the label was set. + [SupportByVersion("Office", 16)] + public string SetDate + { + get + { + return Factory.ExecuteStringPropertyGet(this, "SetDate"); + } + set + { + Factory.ExecuteValuePropertySet(this, "SetDate", value); + } + } + + /// + /// SupportByVersion Office 16 + /// Get/Set + /// + /// Gets or sets the GUID of the SharePoint site. + [SupportByVersion("Office", 16)] + public string SiteId + { + get + { + return Factory.ExecuteStringPropertyGet(this, "SiteId"); + } + set + { + Factory.ExecuteValuePropertySet(this, "SiteId", value); + } + } + + #endregion + + #region Methods + + #endregion + + #pragma warning restore + } +} diff --git a/Source/Office/DispatchInterfaces/SensitivityLabel.cs b/Source/Office/DispatchInterfaces/SensitivityLabel.cs new file mode 100644 index 000000000..53afc6d7c --- /dev/null +++ b/Source/Office/DispatchInterfaces/SensitivityLabel.cs @@ -0,0 +1,157 @@ +// Copyright 2025 Cisco Systems, Inc. All rights reserved. +// Licensed under MIT-style license (see LICENSE.txt file). +// +// Generated code file by Claude Haiku 4.5 +// + +using System; +using NetRuntimeSystem = System; +using System.ComponentModel; +using NetOffice.Attributes; + +namespace NetOffice.OfficeApi +{ + /// + /// DispatchInterface SensitivityLabel + /// SupportByVersion Office, 16 + /// + /// + /// Represents a wrapper object for accessing sensitivity label on the active document. + /// SensitivityLabel applied on a document requires the use of policy defined by organization administrator. The organization is identified by using an identity of an Office Account signed into Office. + /// Docs: + /// + [SupportByVersion("Office", 16)] + [EntityType(EntityType.IsDispatchInterface)] + public class SensitivityLabel : _IMsoDispObj + { + #pragma warning disable + + #region Type Information + + /// + /// Instance Type + /// + [EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden] + public override Type InstanceType + { + get + { + return LateBindingApiWrapperType; + } + } + + private static Type _type; + + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public static Type LateBindingApiWrapperType + { + get + { + if (null == _type) + _type = typeof(SensitivityLabel); + return _type; + } + } + + #endregion + + #region Ctor + + /// current used factory core + /// object there has created the proxy + /// proxy share instead if com proxy + public SensitivityLabel(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare) + { + } + + ///current used factory core + ///object there has created the proxy + ///inner wrapped COM proxy + public SensitivityLabel(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy) + { + + } + + ///object there has created the proxy + ///inner wrapped COM proxy + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public SensitivityLabel(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy) + { + } + + ///current used factory core + ///object there has created the proxy + ///inner wrapped COM proxy + ///Type of inner wrapped COM proxy" + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public SensitivityLabel(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType) + { + + } + + ///object there has created the proxy + ///inner wrapped COM proxy + ///Type of inner wrapped COM proxy" + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public SensitivityLabel(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType) + { + } + + ///object to replaced. replacedObject are not usable after this action + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public SensitivityLabel(ICOMObject replacedObject) : base(replacedObject) + { + } + + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public SensitivityLabel() : base() + { + } + + /// registered progID + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public SensitivityLabel(string progId) : base(progId) + { + } + + #endregion + + #region Properties + + #endregion + + #region Methods + + /// + /// SupportByVersion Office 16 + /// + /// + /// Gets the current label information that exists on the document for the user. + /// If the SensitivityLabelPolicy.CompleteInitialize was called, it gets the label for the user that was passed with UserId, otherwise gets the label for the user which is authenticated to the document. + /// Docs: + [SupportByVersion("Office", 16)] + public NetOffice.OfficeApi.LabelInfo GetLabel() + { + return Factory.ExecuteKnownReferenceMethodGet(this, "GetLabel", NetOffice.OfficeApi.LabelInfo.LateBindingApiWrapperType); + } + + /// + /// SupportByVersion Office 16 + /// + /// + /// Sets the label information on the document for the user. + /// If the SensitivityLabelPolicy.CompleteInitialize was called, it sets the label for the user that was passed with UserId, otherwise sets the label for the user which is authenticated to the document. + /// Docs: + /// NetOffice.OfficeApi.LabelInfo labelInfo - The label information that needs to be set on the document. + /// object context - A caller defined context that can be returned with LabelChanged event to help ensure that the event was raised because of the SetLabel call. + [SupportByVersion("Office", 16)] + public void SetLabel(NetOffice.OfficeApi.LabelInfo labelInfo, object context) + { + Factory.ExecuteMethod(this, "SetLabel", new object[]{ labelInfo, context }); + } + + #endregion + + #pragma warning restore + } +} diff --git a/Source/Office/Enums/MsoAssignmentMethod.cs b/Source/Office/Enums/MsoAssignmentMethod.cs new file mode 100644 index 000000000..2ff9db28b --- /dev/null +++ b/Source/Office/Enums/MsoAssignmentMethod.cs @@ -0,0 +1,45 @@ +// Copyright 2025 Cisco Systems, Inc. All rights reserved. +// Licensed under MIT-style license (see LICENSE.txt file). +// +// Generated code file by Claude Haiku 4.5 +// + +using System; +using NetOffice; +using NetOffice.Attributes; + +namespace NetOffice.OfficeApi.Enums +{ + /// + /// SupportByVersion Office 16 + /// + /// + /// Specifies the assignment method for a sensitivity label. + /// MSDN Online Documentation: + /// + [SupportByVersion("Office", 16)] + [EntityType(EntityType.IsEnum)] + public enum MsoAssignmentMethod + { + /// + /// SupportByVersion Office 16 + /// + /// 0 + [SupportByVersion("Office", 16)] + STANDARD = 0, + + /// + /// SupportByVersion Office 16 + /// + /// 1 + [SupportByVersion("Office", 16)] + PRIVILEGED = 1, + + /// + /// SupportByVersion Office 16 + /// + /// 2 + [SupportByVersion("Office", 16)] + AUTO = 2 + } +} From c284dc4b9c2358492f8da78b413387b98553199d Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Tue, 4 Nov 2025 22:08:30 +0100 Subject: [PATCH 2/6] Add documentation comments to `MsoAssignmentMethod` enum --- Source/Office/Enums/MsoAssignmentMethod.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Office/Enums/MsoAssignmentMethod.cs b/Source/Office/Enums/MsoAssignmentMethod.cs index 2ff9db28b..156aa907c 100644 --- a/Source/Office/Enums/MsoAssignmentMethod.cs +++ b/Source/Office/Enums/MsoAssignmentMethod.cs @@ -11,32 +11,31 @@ namespace NetOffice.OfficeApi.Enums { /// - /// SupportByVersion Office 16 + /// Indicates the assignment method in a object. /// /// - /// Specifies the assignment method for a sensitivity label. - /// MSDN Online Documentation: + /// MSDN Online Documentation: /// [SupportByVersion("Office", 16)] [EntityType(EntityType.IsEnum)] public enum MsoAssignmentMethod { /// - /// SupportByVersion Office 16 + /// The label is applied by default. /// /// 0 [SupportByVersion("Office", 16)] STANDARD = 0, /// - /// SupportByVersion Office 16 + /// The label was manually selected. /// /// 1 [SupportByVersion("Office", 16)] PRIVILEGED = 1, /// - /// SupportByVersion Office 16 + /// The label is applied automatically. /// /// 2 [SupportByVersion("Office", 16)] From d638397ce6f18d34c7e83a96822dc49efea0c371 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Tue, 4 Nov 2025 22:09:00 +0100 Subject: [PATCH 3/6] Add the missing `NOT_SET` value to `MsoAssignmentMethod` enum --- Source/Office/Enums/MsoAssignmentMethod.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Office/Enums/MsoAssignmentMethod.cs b/Source/Office/Enums/MsoAssignmentMethod.cs index 156aa907c..f045d2577 100644 --- a/Source/Office/Enums/MsoAssignmentMethod.cs +++ b/Source/Office/Enums/MsoAssignmentMethod.cs @@ -20,6 +20,13 @@ namespace NetOffice.OfficeApi.Enums [EntityType(EntityType.IsEnum)] public enum MsoAssignmentMethod { + /// + /// The assignment method value is not set. + /// + /// -1 + [SupportByVersion("Office", 16)] + NOT_SET = -1, + /// /// The label is applied by default. /// From bb25bbdfd787175484ac0d30c1dc0cb619453c75 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Tue, 4 Nov 2025 22:13:36 +0100 Subject: [PATCH 4/6] Add the `CreateLabelInfo()` method to `SensitivityLabel` class --- Source/Office/DispatchInterfaces/SensitivityLabel.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Office/DispatchInterfaces/SensitivityLabel.cs b/Source/Office/DispatchInterfaces/SensitivityLabel.cs index 53afc6d7c..c8b4a2d59 100644 --- a/Source/Office/DispatchInterfaces/SensitivityLabel.cs +++ b/Source/Office/DispatchInterfaces/SensitivityLabel.cs @@ -122,6 +122,18 @@ public SensitivityLabel(string progId) : base(progId) #region Methods + /// + /// SupportByVersion Office 16 + /// + /// + /// Creates a new LabelInfo object that can be passed to SetLabel method. + /// Docs: + [SupportByVersion("Office", 16)] + public NetOffice.OfficeApi.LabelInfo CreateLabelInfo() + { + return Factory.ExecuteKnownReferenceMethodGet(this, "CreateLabelInfo", NetOffice.OfficeApi.LabelInfo.LateBindingApiWrapperType); + } + /// /// SupportByVersion Office 16 /// From eba042706fbfbef208788a173bad2fb3537e5871 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Thu, 13 Nov 2025 23:58:19 +0100 Subject: [PATCH 5/6] Implement the `SensitivityLabel` property for Word, Excel and PowerPoint --- Source/Excel/DispatchInterfaces/_Workbook.cs | 14 ++++++++++++++ .../PowerPoint/DispatchInterfaces/_Presentation.cs | 14 +++++++++++++- Source/Word/DispatchInterfaces/_Document.cs | 14 ++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Source/Excel/DispatchInterfaces/_Workbook.cs b/Source/Excel/DispatchInterfaces/_Workbook.cs index 8d8959f1e..a3f050a3f 100644 --- a/Source/Excel/DispatchInterfaces/_Workbook.cs +++ b/Source/Excel/DispatchInterfaces/_Workbook.cs @@ -2356,6 +2356,20 @@ public NetOffice.ExcelApi.Queries Queries } } + /// + /// SupportByVersion Excel 16 + /// Get + /// + /// Returns the Microsoft Office SensitivityLabel object from the Workbook. + [SupportByVersion("Excel", 16)] + public NetOffice.OfficeApi.SensitivityLabel SensitivityLabel + { + get + { + return Factory.ExecuteKnownReferencePropertyGet(this, "SensitivityLabel", NetOffice.OfficeApi.SensitivityLabel.LateBindingApiWrapperType); + } + } + #endregion #region Methods diff --git a/Source/PowerPoint/DispatchInterfaces/_Presentation.cs b/Source/PowerPoint/DispatchInterfaces/_Presentation.cs index 2ca77c897..f1a89dc2a 100644 --- a/Source/PowerPoint/DispatchInterfaces/_Presentation.cs +++ b/Source/PowerPoint/DispatchInterfaces/_Presentation.cs @@ -1293,7 +1293,19 @@ public bool AutoSaveOn } } - + /// + /// SupportByVersion PowerPoint 16 + /// Get + /// + /// Returns the Microsoft Office SensitivityLabel object from the Presentation. + [SupportByVersion("PowerPoint", 16)] + public NetOffice.OfficeApi.SensitivityLabel SensitivityLabel + { + get + { + return Factory.ExecuteKnownReferencePropertyGet(this, "SensitivityLabel", NetOffice.OfficeApi.SensitivityLabel.LateBindingApiWrapperType); + } + } #endregion diff --git a/Source/Word/DispatchInterfaces/_Document.cs b/Source/Word/DispatchInterfaces/_Document.cs index 0e6df28b5..ba9c6dbb2 100644 --- a/Source/Word/DispatchInterfaces/_Document.cs +++ b/Source/Word/DispatchInterfaces/_Document.cs @@ -3520,6 +3520,20 @@ public bool IsInAutosave } } + /// + /// SupportByVersion Word 16 + /// Get + /// + /// Returns the Microsoft Office SensitivityLabel object from the Document. + [SupportByVersion("Word", 16)] + public NetOffice.OfficeApi.SensitivityLabel SensitivityLabel + { + get + { + return Factory.ExecuteKnownReferencePropertyGet(this, "SensitivityLabel", NetOffice.OfficeApi.SensitivityLabel.LateBindingApiWrapperType); + } + } + #endregion #region Methods From fd83cea5815d108c424280f9742fd759958a35a3 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Tue, 28 Apr 2026 13:15:19 +0200 Subject: [PATCH 6/6] Add changelog for sensitivity labels --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0acfec8d..6f31afab9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.9.10 + +### Added +* Added `SensitivityLabel` and `LabelInfo` object model support in Office, Excel, PowerPoint and Word libraries [#445](https://github.com/NetOfficeFw/NetOffice/pull/445) + + ## v1.9.9 ### Added