foreach (DocumentTarget target in textControl1.DocumentTargets)
{
textControl1.Selection.Start = target.Start;
textControl1.Selection.Length = target.Length;//length始终为0
MessageBox.Show(textControl1.Selection.Text);
}
通过以上代码,无法获得已经在WORD文档中定义好的bookmark,length始终为0,textControl1.Selection.Text始终为整个文档的内容。 |