To use the example, run it from the ThisAddIn class in your project.
#Make a form show hide in word code
The following code example can be used in a VSTO Add-in. Ref missing, ref oFalse, ref missing, ref missing, ref missing, ref missing) Ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue, Ref oTrue, ref oFalse, ref range, ref missing, ref missing, ref missing, To use this example, run it from the ThisDocument class in your project. The following code example can be used in a document-level customization. Pass the range of a bookmark to the HideText method, print the document, and then pass the same range to the UnhideText method. Shared Sub UnhideText(ByVal rng As Word.Range) Shared Sub HideText(ByVal rng As Word.Range)Ĭreate a procedure that unhides all text that is in a specified range. To hide text in a Bookmark control while printing the documentĬreate a procedure that hides all text that is in a specified range. For more information, see Features available by Office application and project type. You can hide text in a document by setting the Hidden property of the Font for a particular range of text.įor example, you can temporarily hide the text within a Bookmark (in a document-level customization) or a Bookmark (in a VSTO Add-in) before sending a document to a printer.Īpplies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Word.