Imports Docs.Word



Public Class Tools_Search
	Friend Shared Function Main1() As Document
		'	Open the document with given name
		Dim Doc As Document = Document.ReadDoc(Form1.SourceFolder + "Tools - Search.doc")
		Dim Nodes As NodeList = Doc.Sections.GetNodes()

		'	Get all textruns that contain text "polar" in them
		Dim TRL1 As TextrunList = Search.Find_AllTextruns(Nodes, "polar", False)

		'	Get all ranges of textruns that contain text "Mars" in them
		'	Highlight them by yellow color
		Dim TRL2 As TextrunList = Search.Get_AllRanges(Nodes, "Mars", False)
		TRL2.Style.HighlightColor = Color.Yellow

		Return Doc
	End Function
End Class
