Imports Docs.Word



Public Class Tools_Replace
	Friend Shared Function Main1() As Document
		'	Open the document with given name and get the list of all nodes
		Dim Doc As Document = Document.ReadDoc(Form1.SourceFolder + "Tools - Replace.doc")
		Dim Nodes As NodeList = Doc.Sections.GetNodes()

		'	Replace all "Mars" text entries with "Venus"
		Search.Replace(Nodes, "Mars", "Venus")

		'	Find all "Venus" text entries and highlight them
		Dim TRL = Search.Get_AllRanges(Nodes, "Venus", False)
		TRL.Style.HighlightColor = Color.Yellow

		Return Doc
	End Function
End Class
