Ejemplo n.º 1
0
 public void TestRemovePartB()
 {
     using (var fs = File.Open("./template.docx", FileMode.OpenOrCreate, FileAccess.ReadWrite))
         using (var mould = new Mould(fs))
         {
             var removal = new Removal();
             removal.Add("PartBStart", "PartBEnd");
             mould.RemoveSection(removal);
             mould.Save();
         }
 }
Ejemplo n.º 2
0
        public void TestReplaceAndRemovePartB()
        {
            using (var fs = File.Open("./template.docx", FileMode.OpenOrCreate, FileAccess.ReadWrite))
                using (var mould = new Mould(fs))
                {
                    var removal = new Removal();
                    removal.Add("PartBStart", "PartBEnd");
                    mould.RemoveSection(removal);

                    var replacement = new Replacement();
                    replacement.Add("Field1", "Field1BlaBlaBla111");
                    replacement.Add("Field2", "Field2BlaBlaBla222");
                    replacement.Add("Field3", "Field3BlaBlaBla333");
                    mould.ReplaceField(replacement);
                    mould.Save();
                }
        }