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.