-2

为什么 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);
4

1 回答 1

0

您应该在 ActiveDocument.StoryRanges 之间进行迭代以获取文档中的所有故事类型。就像是:

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

等等。对不起,我不喜欢 c#。

于 2015-09-08T20:35:24.587 回答