Word的页面设置问题-如何设定页面宽度和高度
以下代码将Word的页面宽度设定为15CM,高度设定为12CM.并设定左边距,右边距,上边距以及下边距。
var obj = 控件对象;
var app = obj.ActiveDocument.Application;
var pgSetup = obj.ActiveDocument.PageSetup;
pgSetup.PageWidth = app.CentimetersToPoints(15);
pgSetup.PageHeight = app.CentimetersToPoints(12);
pgSetup.LeftMargin = app.InchesToPoints(0.75);
pgSetup.RightMargin = app.InchesToPoints(0.75);
pgSetup.TopMargin = app.InchesToPoints(1.5);
pgSetup.BottomMargin = app.InchesToPoints(1);
|