public void SetPage(WOrientation orientation, double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin) { oDoc.PageSetup.PageWidth = oWordApplic.CentimetersToPoints((float)width); oDoc.PageSetup.PageHeight = oWordApplic.CentimetersToPoints((float)height); if (orientation == WOrientation.横板) { oDoc.PageSetup.Orientation = Microsoft.Office.Interop.Word.WdOrientation.wdOrientLandscape; } oDoc.PageSetup.TopMargin = (float)(topMargin * 25); //上边距 oDoc.PageSetup.LeftMargin = (float)(leftMargin * 25); //左边距 oDoc.PageSetup.RightMargin = (float)(rightMargin * 25); //右边距 oDoc.PageSetup.BottomMargin = (float)(bottomMargin * 25); //下边距 }
public void SetPage(WOrientation orientation, double topMargin, double leftMargin, double rightMargin, double bottomMargin) { SetPage(orientation, 21, 29.7, topMargin, leftMargin, rightMargin, bottomMargin); }
public void SetPage(WOrientation orientation, double topMargin, double leftMargin, double rightMargin, double bottomMargin) { SetPage(orientation, 21, 29.7, topMargin, leftMargin, rightMargin, bottomMargin); }
public void SetPage(WOrientation orientation, double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin) { wDoc.PageSetup.PageWidth = wApp.CentimetersToPoints((float)width); wDoc.PageSetup.PageHeight = wApp.CentimetersToPoints((float)height); if (orientation == WOrientation.横板) { wDoc.PageSetup.Orientation = Microsoft.Office.Interop.Word.WdOrientation.wdOrientLandscape; } wDoc.PageSetup.TopMargin = (float)(topMargin * 25);//上边距 wDoc.PageSetup.LeftMargin = (float)(leftMargin * 25);//左边距 wDoc.PageSetup.RightMargin = (float)(rightMargin * 25);//右边距 wDoc.PageSetup.BottomMargin = (float)(bottomMargin * 25);//下边距 }