Share via

Microsoft information protection: System.Runtime.InteropServices.COMException (0x800A175C)

Anonymous
2024-03-28T06:57:05+00:00

Hi All,

As AIP is going to be disabled , we have moved from AIP to built-in labeling , we are getting these two exceptions while launching the word from my application.

We are using Microsoft.Office.Interop.Word.dll word interop library for interacting with word, after moving from AIP to built-in, looks tlike here are some changes in policies on how the document is being protected by default. 

We tried to handle these cases in our code, but still we are unable to fix these errors.

Exception 1:

ERROR KEYBINDING 698 failed for macro: Variable

System.Runtime.InteropServices.COMException (0x800A175C): The context cannot be modified.

   at Microsoft.Office.Interop.Word.KeyBindings.Add(WdKeyCategory KeyCategory, String Command, Int32 KeyCode, Object& KeyCode2, Object& CommandParameter)

   at myapp.myapp.Bind()

Exception 2:

EXCEPTION SOURCE: Microsoft Word

myAppCommon.Exceptions.WordUtilityException: WordUtility - SetDocumentProtection Failed ---> System.Runtime.InteropServices.COMException: Command failed

   at Microsoft.Office.Interop.Word.DocumentClass.Unprotect(Object& Password)

   at myapp.WordUtility.SetDocumentProtection(Document _Doc, WdProtectionType _ProtectionType, String _Password, Boolean wrapFormField)

   --- End of inner exception stack trace ---

   at myapp.WordUtility.SetDocumentProtection(Document _Doc, WdProtectionType _ProtectionType, String _Password, Boolean wrapFormField)

   at myapp.myapp.SetDocumentProtection(eEnableState _EnableState, Boolean wrapFormField)

This happens only with after enabling the built-in labeling and disabling the AIP. if we move back to AIP, its working fine, but as from April 1 2024, AIP is being removed, so we have moved to built-in labeling.

Does this requires any policies modifications to microsoft account, could you guide us on this.

Microsoft 365 and Office | Word | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2024-03-28T14:02:51+00:00

Dear respected Dinesh P1,

Good day! Thank you for posting to Microsoft Community. We are happy to help you.

I’m sorry you’re having a problem and for the situation you encountered, we deeply understand the inconvenience caused and apologize for it.

As per your description, it seems that your migration from Azure Information Protection (AIP) to the built-in labeling features in Microsoft 365 has introduced some issues with your existing application with the Microsoft Word object model.

The errors you are encountering suggest that there are conflicts with the document protection and settings that are no longer compatible after the switch to built-in labeling. However, it may need to investigate from the backend side via remote section and collect logs.

As this Forum community has limited resources, the backend support team there has more permission than us, they have more resources to investigate the issue from the backend, they have Escalate channel to escalate your issue to check more and collect log reports for the root cause.

In this situation, we sincerely recommend that you Microsoft 365 admin, can follow the steps in this article and open/create a support ticket to contact online support. The support team there has more permission than us, they can help you remotely and collect logs. They may also involve more resources to investigate the issue from the backend. This would be the most efficient way to handle this case for you.

Note: To create a support ticket, you need to have Microsoft 365 admin privileges and if you aren’t admin of your Office 365 organization, please contact the admin of creating a new ticket.

Reference: How do I find my Microsoft 365 admin? - Microsoft Support

I do feel regret for not resolving the problem and redirecting you to the related development team but the fix to your concern can be find out through the HAR logs and suggest you raise a support ticket from the Office 365 admin center, where the related team will investigate the problem further by collecting the HAR logs.

I'm sorry and I apologize for that.

Appreciate your patience and understanding and thank you for your time and cooperation.

Sincerely,

Waqas Muhammad

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-03-28T16:47:46+00:00

    Hi respected Dinesh P1,

    Thanks for your valuable feedback and sharing updates with us and I really appreciate your effort and your precious time doing. 

    And I appreciate your kind words.

    For Azure Information Protection (AIP) to the built-in label, you go toMicrosoft Q&A Community, which is the specific channel to handle such situation. You may use Azure Information Protection tag when" Ask a question". The engineers in related team will focus on your specific scenario and provide specific suggestions.

    I'm sorry and I apologize for it.

    Your understanding and patience will be highly appreciated. I hope that you are keeping safe and well!

    Sincerely,

    Waqas Muhammad

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-03-28T16:32:55+00:00

    Hi Waqas Muhammad,

    when we use 2308 (Build 16731.20234), in one of the machine it works as expected, but in another two machines causing us again below issue

    Exception 1:

    Thursday, March 28, 2024 12:28:32 PM ERROR KEYBINDING 264 failed for macro: xEditor_Backspace

    Thursday, March 28, 2024 12:28:32 PM ERROR

    System.Runtime.InteropServices.COMException (0x800A175C): The context cannot be modified.

    at Microsoft.Office.Interop.Word.KeyBindings.Add(WdKeyCategory KeyCategory, String Command, Int32 KeyCode, Object& KeyCode2, Object& CommandParameter)

    at myapp.EditorKeyBind.Bind()

    Exception 2:

    The AutoHyphenation method or property is not available because a macro is currently running.

    Thursday, March 28, 2024 12:28:33 PM ERROR

    System.Runtime.InteropServices.COMException (0x800A11FD): The AutoHyphenation method or property is not available because a macro is currently running.

    at myapp.myapp.Start()

    at myapp.Controllers.xEditorController.LoadWIP(String _ConfigFullPath)

    EXCEPTION SOURCE: Microsoft Word
    

    These issues also occur if we move to built-in label only and not with AIP.

    Can we know if there is any separate forum or channel for these issues related to AIP to built-in label migration.

    also could you let us know if any latest version of Microsoft.Office.Interop.Word.dll is related to make it compatible with AIP to built-in label migration.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-03-28T15:53:54+00:00

    Hi respected Dinesh P1,

    Thanks for your valuable feedback and sharing updates with us and I really appreciate your effort and your precious time doing. 

    And I appreciate your kind words.

    Azure Information Protection (AIP) to the built-in labeling in Microsoft Office applications can indeed introduce complexities due to changes in how document protection and labeling are handled. Your issue seems to be specifically related to how the Microsoft Office Interop interacts with Word's new built-in labeling system.

    Regarding your first description scenario, the exceptions you're encountering suggest that there's a conflict or incompatibility between your application and the new built-in labeling feature. The errors indicate issues with key binding and document protection methods, which may be due to the built-in labeling enforcing different defaults or restrictions on document protection.

    Since you mentioned you're not facing the issue with version 2308 (Build 16731.20234) of Microsoft Office suggests that Microsoft may have addressed the compatibility issues in this later version. This could be due to changes or improvements in the Office built-in labeling functionality itself.

    It's possible that the improvements or changes made in version 2308 rectify the compatibility issues your application is facing. This could be due to enhancements in the Interop library or changes in how built-in labeling is implemented.

    I'm sorry and I apologize for it.

    Your understanding and patience will be highly appreciated. I hope that you are keeping safe and well!

    Sincerely,

    Waqas Muhammad

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-03-28T15:41:05+00:00

    Thank you for the reply Waqas Muhammad .
    As built-in labeling is enabled by default from 2302 version(current and semi annual). I have tried with 2308(Version 2308 (Build 16731.20234), we are not facing any issue with this version, Can we know why it worked in later version.

    or it is like later version of 2308 have this built-in labeling is enabled ?Could you clarify on this.

    Was this answer helpful?

    0 comments No comments