using System;
using System.Drawing;
using Docs.Word;


namespace SampleManager
{
	class Tools_Replace
	{
		internal static Document Main1()
		{
			//	Open the document with given name and get the list of all nodes
			Document Doc = Document.ReadDOC(Form1.SourceFolder + "Tools - Replace.doc");
			NodeList Nodes = Doc.Sections.GetNodes();

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

			//	Find all "Venus" text entries and highlight them
			var TRL = Search.Get_AllRanges(Nodes, "Venus", false);
			TRL.Style.HighlightColor = Color.Yellow;
			
			return Doc;
		}
	}
}
