private void button1_Click(object sender, EventArgs e) { Document document = new Document(); Section section = document.AddSection(); //page setup SetPage(section); //insert header and footer. InsertHeaderAndFooter(section); //add title AddTitle(section); //add form AddForm(section); //protect document, only form fields could be edited. document.Protect(ProtectionType.AllowOnlyFormFields, "e-iceblue"); //Save doc file. document.SaveToFile("Sample.doc",FileFormat.Doc); //Launching the MS Word file. WordDocViewer("Sample.doc"); }