1 object oMissing = System.Type.Missing;
2 object objStyleName = "正文";
3 MSWord.Style style = _doc.Application.ActiveDocument.Styles.get_Item(ref objStyleName);
4 object oCustomStyle = style;
5
6 selectFind.Text = "";
7 selectFind.ClearFormatting();
8 selectFind.set_Style(ref oCustomStyle);
9 selectFind.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
10 selectFind.Replacement.ClearFormatting();
11
12 bool b = selectFind.Execute(ref oMissing,
13 ref oMissing, ref oMissing, ref oTrue, ref oMissing, ref oMissing, ref oMissing,
14 ref WdFindWrap, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
15 ref oMissing, ref oMissing);