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

dkarthik363 0 Reputation points
2024-03-29T05:04:07.0733333+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.

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.

Azure Information Protection
Azure Information Protection
An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.
516 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,489 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 33,801 Reputation points Microsoft Employee
    2024-03-29T21:42:29.2733333+00:00

    Hi @dkarthik363 ,

    If you are not seeing the errors go away on all of the machines while using Version 2308 Build 16731.20234 , you may also want to update to Version 2403 (Build 17425.20138) since there were some additional fixes to labeling that were added in the later versions. https://learn.microsoft.com/en-us/officeupdates/current-channel#version-2403-march-27

    There is an active bug right now that is causing the System.Runtime.InteropServices.COMException to be thrown in multiple services, but without being able to investigate your setup and collect logs it is difficult to know if your situation is related.

    The errors you cited typically indicate conflicts with the document protection and settings that are no longer compatible after the switch to built-in labeling.

    If you send me an email at AzCommunity@microsoft.com ("Attn: Marilee Turscak") and include your subscription ID and a link to this thread, I can open a one-time free support case to investigate your particular issue and isolate the root cause.

    If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar questions.