在PB中控制Word的页边距

//设置页边距,后2个参数为页眉和页脚的高度
//其中参数单位为“厘米CM”,Word里面是用磅为单位,1英尺等于72磅,1厘米等于0.3937英尺

Try
    ole_document.PageSetup.TopMargin      = Top    * 28.3464
    ole_document.PageSetup.BottomMargin   = Bottom * 28.3464
    ole_document.PageSetup.LeftMargin     = Left   * 28.3464
    ole_document.PageSetup.RightMargin    = Right  * 28.3464
    ole_document.PageSetup.HeaderDistance = Header * 28.3464
    ole_document.PageSetup.FooterDistance = Footer * 28.3464
Catch(RunTimeError e)
    ErrorText = "设置页边距失败.错误信息:~r~n" + e.GetMessage()
    Return -1
End Try

Return 1 

版权声明:本文为sunday_hl原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。