【发布时间】:2019-09-17 11:40:27
【问题描述】:
我正在使用 FindAndReplace 之类的内置函数将 Word 文档中的某些文本替换为新文本。但是当想要的文本在文本框内时,函数似乎找不到它。
我的代码:
object matchCase = true;
object matchWholeWord = true;
object matchWildCards = false;
object matchSoundLike = false;
object nmatchAllforms = false;
object forward = true;
object format = true;
object matchKashida = false;
object matchDiactitics = false;
object matchAlefHamza = false;
object matchControl = false;
object read_only = false;
object visible = true;
object replace = 2;
object wrap = 1;
var range = myWordDoc.Range();
//Finds the parameter, then replaces
range.Find.Execute("replaceable",
ref matchCase, ref matchWholeWord,
ref matchWildCards, ref matchSoundLike,
ref nmatchAllforms, ref forward,
ref wrap, ref format, "value",
ref replace, ref matchKashida,
ref matchDiactitics, ref matchAlefHamza,
ref matchControl);
有一个选项可以遍历文件中的所有文本框并在内部文本上调用函数? (实际上并没有用这样的新文本替换里面的整个文本:)
shape.TextFrame.TextRange.Text = resultingText;
提前谢谢你!
【问题讨论】: