回复 6楼ninja_aya的帖子
无界面操作文档需要使用 servertextcontrol,请查看下面代码是否符合您的需求:
- private void fToolStripMenuItem_Click(object sender, EventArgs e)
- {
- TXTextControl.ServerTextControl svt1 = new TXTextControl.ServerTextControl();
- svt1.Create();
- svt1.Load("..\\..\\1.tx", TXTextControl.StreamType.InternalUnicodeFormat);
- TXTextControl.ServerTextControl svt2 = new TXTextControl.ServerTextControl();
- svt2.Create();
- svt2.Load("..\\..\\1.tx", TXTextControl.StreamType.InternalUnicodeFormat);
- TXTextControl.Section s = svt1.Sections[5];
- s.Select();
- svt1.Selection.Save("..\\..\\test.tx", TXTextControl.StreamType.InternalUnicodeFormat);
- svt2.Selection.Start = svt2.Sections[6].Start;
- svt2.Selection.Length = 0;
- svt2.Selection.Load("..\\..\\test.tx", TXTextControl.StreamType.InternalUnicodeFormat);
- svt2.Save("..\\..\\4.tx", TXTextControl.StreamType.InternalUnicodeFormat);
- textControl2.Load("..\\..\\4.tx", TXTextControl.StreamType.InternalUnicodeFormat);
- }
复制代码
直接覆盖 fToolStripMenuItem_Click 事件即可。 |