Word field is invisible - current channel
I am working on an add-in for Microsoft Word, VSTO application, we are doing content tagging with Word.Fields, and it was working fine for several years. Suddenly users reported failures in inserting tags. And all the users who reported the issue are using Office 2412 build or latest on the current channel. I am using 2411 and I am on Monthly enterprise channel, issue is not recreating for me.
Below is an image of the field codes of the correct and with issue tag
In the tag with issue, it contains all the field codes and values, the missing part (compared to the other tag) is actually hidden. If you look carefully in the highlighted place, I have selected the missing Word.field
in there using field.Select
using vba. I can read it's content through code.
Also users having error pop-up when inserting the field codes at the end of the document. We have a logic handle for that instance in our original code, we add a empty paragraph at the end of the document using range.InsertParagraphAfter
. seems that is not working now. I tried giving the user a test build with objWordRange.InsertAfter("\r");
instead of all instances of range.InsertparagraphAfter
and it seems to fix that issue as user now don't have that error (can't 100% sure, anyway error is now not in their logs). But the objWordRange.InsertAfter("\r");
didn't fix the field code invisible issue.
We are using range.InsertparagraphAfter
and range.Collapse(Word.WdCollapseDirection.wdCollapseEnd);
, range.Collapse(Word.WdCollapseDirection.wdCollapseStart);
several times within this tag insertion. But when inserting the invisible tag, code seems not functioning as implemented, as it is selecting in a weird location as seen in that screenshot. Any idea or hints on what we need to make the code working back soon? as it is really urgent. Note : Out IT team is working on getting me current channel of Word. Still it is in progress.