Through a Microsoft.Office.Interop.Word.Application object, i want to execute the “InkHighlighter” mso after i opened a document, but if i try to execute it, i get the following error:
“System.Runtime.InteropServices.COMException: ‘Error HRESULT E_FAIL has been returned from a call to a COM component.'”
I checked the GetEnabledMso and GetVisibleMso methods, the latter returned with a false value, I think that’s why the problem occurs
var isInkHighlighterMsoEnabled = _app.CommandBars.GetEnabledMso("InkHighlighter");
var isInkHighlighterMsoVisible = _app.CommandBars.GetVisibleMso("InkHighlighter");
_app.CommandBars.ExecuteMso("InkHighlighter");
Any idea how i can execute the InkHighlighter code-behind?
(Btw the above code works well with “InkEraser”)