dont write in word with docx.dll

Jan 9, 2015 at 6:23 AM
Edited Jan 9, 2015 at 6:23 AM
iam use word2013
this use my code but dont write in word please see pic
](http://8pic.ir/images/vtu3lmke9zh4bminfib3.png)
public void createdoc()
     {
         var filePath = Path.Combine(HttpContext.Current.Server.MapPath("~/template/Main/test") + ".docx");
         var oWordApplication = new Application();
         using (DocX document = DocX.Load(filePath))
         {
             Formatting matchFormatting = new Formatting();
             matchFormatting.Size = 10;
             matchFormatting.Italic = true;
             matchFormatting.FontFamily =
             new System.Drawing.FontFamily("Times New Roman");

             // The new formatting to apply.
             Formatting newFormatting = new Formatting();
             newFormatting.Size = 22;
             newFormatting.UnderlineStyle = UnderlineStyle.dotted;
             newFormatting.Bold = true;

                document.ReplaceText("saeed", "test1", true, RegexOptions.IgnoreCase);
             document.ReplaceText("amir", "test2", true, RegexOptions.IgnoreCase);

             // Save changes made to this document