标题:想用vb修改word中标题正文的格式,请大神指路
只看楼主
超级刘小鑫
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2018-1-19
结帖率:0
已结贴  问题点数:20 回复次数:2 
想用vb修改word中标题正文的格式,请大神指路
比如说 标题1,小四,黑体,加粗,首行不缩进,段前断后0.5行,页边距全部3厘米
正文,五号,宋体,不加粗,首行2字符,段前断后0.5行,页边距全部3厘米
表格中字体小五,宋体,居中
搜索更多相关主题的帖子: vb 修改 word 标题 格式 
2018-01-19 10:00
xiangyue0510
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:86
帖 子:934
专家分:5244
注 册:2015-8-10
得分:10 
手动操作录制一段宏,然后修改一下不就可以了
2018-01-19 11:23
wds1
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:49
帖 子:393
专家分:2025
注 册:2016-3-10
得分:10 
楼上方法可行,稍微改一下就行。
下面是我以前做的,请参考
Dim wd As New Word.Application
 Set ap = CreateObject("word.application")
 Set doc = ap.Documents.Add
  wd.Documents.Add DocumentType:=wdNewBlankDocument
  wd.ActiveWindow.ActivePane.View.Zoom.Percentage = 100 '页面显示100%
 With wd.ActiveDocument.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientLandscape
        .TopMargin = CentimetersToPoints(1)
        .BottomMargin = CentimetersToPoints(1)
        .LeftMargin = CentimetersToPoints(1)
        .RightMargin = CentimetersToPoints(1)
        .Gutter = CentimetersToPoints(0)
        .HeaderDistance = CentimetersToPoints(1.5)
        .FooterDistance = CentimetersToPoints(1.75)
        .PageWidth = CentimetersToPoints(29.7)
        .PageHeight = CentimetersToPoints(21)
        .FirstPageTray = wdPrinterDefaultBin
        .OtherPagesTray = wdPrinterDefaultBin
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .VerticalAlignment = wdAlignVerticalTop
        .SuppressEndnotes = False
        .MirrorMargins = False
        .TwoPagesOnOne = False
        .BookFoldPrinting = False
        .BookFoldRevPrinting = False
        .BookFoldPrintingSheets = 1
        .GutterPos = wdGutterPosLeft
        .LayoutMode = wdLayoutModeLineGrid
  End With
2018-01-20 12:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-484343-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.341492 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved