首页 > 代码库 > 2014.10.1 Word技巧

2014.10.1 Word技巧

设置每页都出现的表头

wordDoc.Tables[tab].Rows[1].HeadingFormat = (int)Word.WdConstants.wdToggle;

 

//合并单元格

wordDoc.Tables[tab].Cell(row - dm.antms.Count, 1).Merge(wordDoc.Tables[tab].Cell(row-1, 1));

 

设置页码    

object oAlignment = Word.WdPageNumberAlignment.wdAlignPageNumberCenter;

object oFirstPage = true ;

wordApp.Selection.Sections[1].Footers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.Add(ref oAlignment,ref oFirstPage);

 

//去除页眉上的横线

wordApp.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekCurrentPageHeader;//定位到页眉

wordApp.Selection.ParagraphFormat. Borders[Word.WdBorderType.wdBorderBottom].LineStyle = Word.WdLineStyle.wdLineStyleNone;//

2014.10.1 Word技巧