如何查找全文居中的段落?

 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);

 

posted on 2014-12-22 10:09  whl-hl  阅读(222)  评论(0)    收藏  举报

导航