How to search for a specific font in a Word document with iterop

后端 未结 3 1835
忘掉有多难
忘掉有多难 2021-01-23 07:42

I use something like this:

doc.Content.Find.Font.Name = \"Times New Roman\";

but when I step through the code the Name property doesn\'t change

3条回答
  •  太阳男子
    2021-01-23 08:14

    Thanks for your reply, but no you don't get a new Find object each time you use dot notation. The problem is you shouldn't use Doc.Content.Find in this kind of situation. Instead you have to create a new Range object and use its Find. Something like this:

    Word.Range range = doc.Range(0, doc.Content.End);
    

提交回复
热议问题