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


namespace SampleManager
{
	class Open_Edit_Save
	{
		internal static Document Main1()
		{
			//	Open the document with given name
			Document Doc = Document.ReadDOC(Form1.SourceFolder + "OpenEditSave.doc");

			//	Get the first paragraph of document
			//	Adds the new textrun at the end of this paragraph
			Paragraph Par1 = (Paragraph)Doc.Sections[0].Nodes[0];
			Par1.AddTextrun(" Hello! Hello!");

			//	Get the second paragraph and changes style properties of its textruns
			Paragraph Par2 = (Paragraph)Doc.Sections[0].Nodes[1];
			Par2.Textruns.Style.FontStyle.Italic = true;
			Par2.Textruns.Style.FontStyle.Bold = false;
			Par2.Textruns.Style.TextColor = Color.Blue;

			return Doc;
		}
	}
}
