'''' This code is part of Document Solutions for Word demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsGrapeCity.Documents.Word '' This sample demonstrates the DsWord Data/Report Templates API,'' which allows developers to retrieve all template tags from a document,'' along with details such as tag text, associated data element (if any),'' and the tag's location within the document.'''' In this sample, we retrieve all tags and replace each with a sequence of 'x' characters.'''' See also: MarkTagsInPDF for an example of using this API in PDF export scenarios.PublicClassXingTemplateTagsFunctionCreateDocx() AsGcWordDocumentDim doc = NewGcWordDocument() doc.Load(Path.Combine("Resources", "WordDocs", "House_Rental_Template.docx"))'' Fetch information about all data template tags in the document:Dim tagInfos = doc.DataTemplate.GetTemplateTagInfos()'' Replace all tags with sequences of 'X' character:ForEach tagInfo AsGrapeCity.Documents.Word.Templates.TemplateTagInfoIn tagInfosDim tagText = tagInfo.Text tagInfo.Range.Replace(tagText, NewString("x"c, tagText.Length))NextReturn docEndFunctionEndClass