Word field is invisible - current channel

ApsSanj 6 Reputation points
2025-01-20T17:41:29.18+00:00

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 tagissue

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.

Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
934 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.
4,180 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.