找回密码
 加入
搜索
查看: 4961|回复: 2

[AU3基础] 怎么用VBA在word的页脚中插入文字和页码,如“第X页 共Y页”(已自行解决)

[复制链接]
发表于 2013-7-5 19:06:20 | 显示全部楼层 |阅读模式
本帖最后由 gczxhzb 于 2013-7-7 10:32 编辑

怎么用VBA在word的页脚中插入文字和页码,如“第X页 共Y页”?

已自行解决,下面的代码可以在AU3中直接使用。
$oDoc.PageSetup.FooterDistance = 30;设置页脚
        $oWordApp.ActiveWindow.ActivePane.View.SeekView = 10
        With $oWordApp.Selection
                .Font.Name = "宋体"
                .Font.size = 10
                .Font.bold = True
                .TypeText("第")
                .Fields.Add($oWordApp.Selection.Range, 33, "PAGE  ", True)
                .TypeText("页 共")
                .Fields.Add($oWordApp.Selection.Range, 26, "NUMPAGES   ", True)
                .TypeText("页")
                .ParagraphFormat.Alignment = 1
        EndWith
发表于 2013-7-10 07:38:29 | 显示全部楼层
谢谢!谢谢提供
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-26 19:14 , Processed in 0.071318 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表