写材料word和PPT
创始人
2025-01-09 08:07:50
0

一、WORD
1、写内容
2、参考GPT改:内容、逻辑结构、语句
3、查标题及其标号
4、修改格式:仿宋 、正文统一为小三,标题三号,1.5倍行距,加页码。

采用VBA代码自动修改,不知为何标题无法修改字体

Sub 插入页码_及设置格式()      Dim rng As Range     Dim par As Paragraph      ' 设置正文格式     Set rng = ActiveDocument.Range     With rng         .Font.Name = "仿宋" ' 设置字体为仿宋         .Font.Size = 15 ' 设置字号为小三(这里以15磅为例,具体大小依Word的字体设置为准)         .ParagraphFormat.LineSpacingRule = wdLineSpace150Percent ' 设置1.5倍行距     End With      ' 设置标题格式并居中     For Each par In ActiveDocument.Paragraphs         If par.Range.Style.NameLocal = "Heading 1" Then ' 假设一级标题使用样式 "Heading 1"             With par.Range.Font                 .Size = 30 ' 设置字号为三号(Word中默认三号为16磅)                 .Name = "仿宋" ' 设置字体为仿宋             End With             par.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter ' 设置标题居中         End If     Next par      ' 添加页码     ActiveDocument.PageSetup.OddAndEvenPagesHeaderFooter = False '关闭奇偶页相同(防止上回启用奇偶页不同后没有关闭此项设置)      With ActiveWindow.ActivePane.View          .SeekView = wdSeekCurrentPageFooter          With Selection              .Expand wdStory              .Font.Size = 9 '字号(小五)             .Font.Name = "仿宋" '字体              .ParagraphFormat.Alignment = wdAlignParagraphCenter              .TypeText "第 "             .Font.Name = "Times New Roman" '字体             .Fields.Add .Range, wdFieldPage             .Font.Name = "仿宋" '字体             .TypeText " 页" ' 在数字和“页”之间增加空格          End With          .SeekView = wdSeekMainDocument '退出页码的编辑(即关闭页眉和页脚工具栏)      End With  End Sub 

VBA 自动雅黑

Sub ChangeFontInAllSlides()
Dim oSlide As Slide
Dim oShape As Shape
Dim oTable As Table
Dim oRow As Row
Dim oCell As Cell
Dim oTxtRange As TextRange
Dim oGroup As Shapes
Dim oChildShape As Shape

' 遍历演示文稿中的所有幻灯片 For Each oSlide In ActivePresentation.Slides     ' 遍历幻灯片中的所有形状     For Each oShape In oSlide.Shapes              ' 如果形状包含文本框         If oShape.HasTextFrame Then             Set oTxtRange = oShape.TextFrame.TextRange             ' 设置文本框中文本的字体属性             With oTxtRange.Font                 .Name = "微软雅黑"                                  '.Size = 14                 '.Color.RGB = RGB(255, 0, 0)                 '.Bold = True                 .Italic = False                 .Underline = False             End With             ' 行距1.5               oTxtRange.ParagraphFormat.SpaceWithin = 1.5         End If                  ' 如果形状是组合图形                  If oShape.Type = msoGroup Then             ' 直接遍历组合图形内的子形状             For i = 1 To oShape.GroupItems.Count                 Set oChildShape = oShape.GroupItems.Item(i)                 ' 如果子形状包含文本框                 If oChildShape.HasTextFrame Then                     Set oTxtRange = oChildShape.TextFrame.TextRange                     ' 设置文本框中文本的字体属性                     With oTxtRange.Font                         .Name = "微软雅黑"                                                  '.Size = 14                         '.Color.RGB = RGB(255, 0, 0)                         '.Bold = True                         .Italic = False                         .Underline = False                     End With                     ' 行距1.5                     oTxtRange.ParagraphFormat.SpaceWithin = 1.5                 End If             Next i         End If                              ' 如果形状包含表格         If oShape.HasTable Then             Set oTable = oShape.Table             ' 遍历表格中的所有行和单元格             For Each oRow In oTable.Rows                 For Each oCell In oRow.Cells                     If oCell.Shape.HasTextFrame Then                         Set oTxtRange = oCell.Shape.TextFrame.TextRange                         ' 设置表格单元格中文本的字体属性                         With oTxtRange.Font                             .Name = "微软雅黑"                              '.Size = 20                              '.Color.RGB = RGB(255, 0, 0)                              '.Bold = True                             .Italic = False                             .Underline = False                         End With                     End If                 Next oCell             Next oRow         End If     Next oShape Next oSlide 

End Sub

相关内容

热门资讯

wpk透明挂!德州nzt软件(... 1、wpk透明挂!德州nzt软件(透视)一直存在有挂(详细辅助透明挂教程);代表性(透视辅助软件透明...
透视代打!werplan外挂(... 透视代打!werplan外挂(透视)最初是真的有挂(详细辅助必胜教程);werplan外挂软件透明挂...
透视规律!智星德州菠萝插件官网... 透视规律!智星德州菠萝插件官网(透视)详细辅助攻略教程(真是存在有挂);1)智星德州菠萝插件官网辅助...
透视真的!wepower辅助器... 透视真的!wepower辅助器,wepoke软件透明挂测试,详细透视wpk教程1)wepower辅助...
aapoker透明挂!wpk微... aapoker透明挂!wpk微扑克俱乐部(透视)果然真的有挂(详细辅助技巧教程);是一款可以让一直输...
透视最新!wepoker黑侠辅... 透视最新!wepoker黑侠辅助器正版下载(透视)确实有挂(详细辅助科技教程);玩家必备必赢加哟《1...
透视玄学!智星德州有脚本吗(透... 透视玄学!智星德州有脚本吗(透视)详细辅助我来教教你(果然是有挂)1、超多福利:超高返利,海量正版游...
wepoke黑科技!微扑克辅助... wepoke黑科技!微扑克辅助是什么(透视)切实存在有挂(详细辅助科技教程)是一款可以让一直输的玩家...
透视有挂!WePoKe外 挂,... 透视有挂!WePoKe外 挂,weopke真的吗,详细透视黑科技教程;1、下载好WePoKe外 挂辅...
透视挂透视!HH平台挂(透视)... 透视挂透视!HH平台挂(透视)素来是真的有挂(详细辅助wpk教程)是由北京得HH平台挂黑科技有限公司...