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


namespace SampleManager
{
	class Tools_Search
	{
		internal static Document Main1()
		{
			//	Open the document with given name
			Document Doc = Document.ReadDOC(Form1.SourceFolder + "Tools - Search.doc");
			NodeList Nodes = Doc.Sections.GetNodes();

			//	Get all textruns that contain text "polar" in them
			TextrunList TRL1 = Search.Find_AllTextruns(Nodes, "polar", false);

			//	Get all ranges of textruns that contain text "Mars" in them
			//	Highlight them by yellow color
			TextrunList TRL2 = Search.Get_AllRanges(Nodes, "Mars", false);
			TRL2.Style.HighlightColor = Color.Yellow;
			
			return Doc;
		}
	}
}
