要循环,您可以使用官方示例:
https ://docs.microsoft.com/en-us/visualstudio/vsto/how-to-programmatically-loop-through-found-items-in-documents?view=vs-2019
rng.Find.ClearFormatting();
rng.Find.Forward = true;
rng.Find.Text = "find me";
rng.Find.Execute(
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing);
while (rng.Find.Found)
{
intFound++;
rng.Find.Execute(
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing);
}
在你的情况下改变 if with while
while (rngCitations.Find.Execute())
{
rngCitations.Font.Superscript = 1;
rngCitations.Font.Bold = 1;
}