为什么Word.Application.Selection.Find.Execute不能在脚注和尾注中工作



为什么Word.Application.Selection.Find.Execute不能在脚注和尾注中工作?我的代码是:

object wrap = WdFindWrap.wdFindContinue;
object wdReplaceAll = WdReplace.wdReplaceAll;
object text = findWhat;
object replaceText = replaceWith;
object missing = Type.Missing;
object bFormat = true;
object forward = true;
Common.WordApplication.Selection.Find.Execute(ref text, ref missing, ref     missing,
ref missing, ref missing, ref missing, ref forward,
ref wrap, ref bFormat, ref replaceText, ref wdReplaceAll,
ref missing, ref missing, ref missing, ref missing);

您应该在ActiveDocument之间迭代。StoryRanges获取文档中的所有故事类型。比如:

word.Range myRange = ActiveDocument.StoryRanges[wdMainTextStory]
word.Range myRange = ActiveDocument.StoryRanges[wdFootnotesStory]
myRange.Find.Execute(your parameters)

以此类推。对不起,我不喜欢c#。

相关内容

  • 没有找到相关文章

最新更新