'''' This code is part of Document Solutions for Word demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.LinqImportsGrapeCity.Documents.Word '' This sample shows how to find all occurrences of a string'' in a DOCX document (see JsFrameworkExcerpt) using the'' RangeBase.Find extension method provided by the'' RangeBaseFindReplaceExtensions class.PublicClassFindAllPublicFunctionCreateDocx() AsGcWordDocument'' The string to find. Note that we use all lowercase,'' as we specify the ignore case option in the find callConstfindPattern = "javascript framework" '' Load the document:Dim doc = NewGcWordDocument() doc.Load(Path.Combine("Resources", "WordDocs", "JsFrameworkExcerpt.docx")) '' Find all occurrences of the search string, ignoring the case:Dim finds = doc.Body.Find(findPattern, NewFindOptions(doc) With {.IgnoreCase = True}) '' Print the number of found occurrences at the top of the document doc.Body.Paragraphs.Insert($"Found {finds.Count()} occurrences of '{findPattern}' in the document." + vbCrLf + vbCrLf, InsertLocation.Start) '' DoneReturn docEndFunctionEndClass