//插入
TextField field = new TextField();
field.Text = "ABC";
_textControl.TextFields.Add(field);
//保存
_textControl.Save(AppDomain.CurrentDomain.BaseDirectory + "\\word.doc", TXTextControl.StreamType.MSWord);
//读取
TXTextControl.LoadSettings ls = new TXTextControl.LoadSettings();
ls.ApplicationFieldFormat = TXTextControl.ApplicationFieldFormat.MSWord;
ls.ApplicationFieldTypeNames = new string[] { "MERGEFIELD" };
_textControl.Load(AppDomain.CurrentDomain.BaseDirectory + "\\word.doc",TXTextControl.StreamType.MSWord, ls);
TXTextControl.ApplicationFieldCollection afc =_textControl.ApplicationFields; |