word vba自動(dòng)化排版-設(shè)置標(biāo)題模板樣式、標(biāo)題、正文、圖表、頁(yè)面、上下標(biāo)等設(shè)置、刪除空白行、刪除分頁(yè)符分節(jié)符、刪除空格等
目錄
1.前提
2.思路
3.word中設(shè)置
4.效果圖
5.經(jīng)驗(yàn)教訓(xùn)
6.直接上代碼
1.前提
? ? ? ? 需求:工作中涉及自動(dòng)識(shí)別大量的文字報(bào)告(ocr完成),然后對(duì)報(bào)告進(jìn)行排版,手動(dòng)排版效率超級(jí)慢,因此探索了一下word vba自動(dòng)排版
? ? ? ? 參考:chatgpt、word vba官網(wǎng)文檔、這篇博客csdn、這篇博客知乎、還有上下標(biāo)的博客不知出處
? ? ? ? 注意:不要期望別人都給代碼注釋好這個(gè)參數(shù)、這個(gè)函數(shù)是什么作用什么意思,像CentimetersToPoints、CharacterUnitFirstLineIndent等等,去官網(wǎng)文檔查看一下才最有深刻印象。
著重理解官網(wǎng)文檔selection、activedocument的關(guān)聯(lián),以及word 對(duì)象之間的關(guān)聯(lián)(主要看對(duì)象屬性里面有哪些 跳轉(zhuǎn)一下查看),像inlinshape.range.ParagraphFormat嵌入式圖片的段落樣式設(shè)置等等。。。
2.思路
? ? ? ?先了解一下基礎(chǔ)語(yǔ)法!
????????①對(duì)于標(biāo)題模板樣式、段落文字的樣式設(shè)置 主要用錄制宏來(lái)實(shí)現(xiàn),基于此修改代碼
? ? ? ? ②對(duì)于find、段落、document、selection等的函數(shù)參數(shù)要去官網(wǎng)查看文檔
? ? ? ? ③對(duì)于刪除分頁(yè)符等參考的chatgpt,國(guó)內(nèi)的大模型不行
? ? ? ? ④對(duì)于上下標(biāo),參考的不知出處的博客-感謝
? ? ? ? ⑤設(shè)置圖表樣式 參考官網(wǎng)、博客、chatgpt
? ? ? ? 錄制宏不是萬(wàn)能的,對(duì)于刪除分頁(yè)符、設(shè)置圖表樣式這樣的操作,錄制宏的代碼單獨(dú)執(zhí)行不起作用!
? ? ? ? 若想精通熟練使用vba進(jìn)行排版,還是需要去官網(wǎng)了解vba的對(duì)象結(jié)構(gòu),以及函數(shù)用法。
? ? ? ? 直接上手用,若復(fù)雜操作會(huì)比較依賴chatgpt,實(shí)際上很多參數(shù)不知道啥作用,查看官方文檔需要較長(zhǎng)時(shí)間理解。
? ? ? ? 代碼可以在wps中運(yùn)行,但是樣式有的不盡人意。
3.word中設(shè)置
? ? ? ? ①先設(shè)置 開(kāi)發(fā)工具:文件->選項(xiàng)->信任中心設(shè)置->啟用宏
? ? ? ? ②打開(kāi) 開(kāi)發(fā)工具->vb編輯器->工具->引用->勾選“Microsoft VBScript Regular Expressions 5.5”
4.效果圖
? ? ? ? TODO
5.經(jīng)驗(yàn)教訓(xùn)
? ? ? ? ①對(duì)于段落(非圖表)參數(shù)越多越好,參數(shù)之間會(huì)互相影響(使用錄制宏)
? ? ? ? ②對(duì)于圖表,參數(shù)不一定越多越好,有的參數(shù)互相影響,導(dǎo)致效果有問(wèn)題文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-800972.html
6.直接上代碼
? ? ? ? 涉及:設(shè)置標(biāo)題圖片模板樣式、標(biāo)題、正文、圖表、頁(yè)面、上下標(biāo)等樣式、刪除空白行、刪除分頁(yè)符分節(jié)符、刪除空格等文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-800972.html
Sub 設(shè)置標(biāo)題正文模板樣式1()
'
' 設(shè)置標(biāo)題正文模板樣式 宏
' 設(shè)置2級(jí)標(biāo)題、正文的字體段落、圖片樣式模板
'
With ActiveDocument.Styles(wdStyleHeading2).Font
.NameFarEast = "宋體"
.NameAscii = "Times New Roman"
.NameOther = "Times New Roman"
.Name = "Times New Roman"
.Size = 22
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Scaling = 100
.Kerning = 1
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.Ligatures = wdLigaturesNone
.NumberSpacing = wdNumberSpacingDefault
.NumberForm = wdNumberFormDefault
.StylisticSet = wdStylisticSetDefault
.ContextualAlternates = 0
End With
With ActiveDocument.Styles(wdStyleHeading2).ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphCenter
.WidowControl = False
.KeepWithNext = False
.KeepTogether = True
.PageBreakBefore = True
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(0)
.OutlineLevel = wdOutlineLevel2
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
.CollapsedByDefault = False
.AutoAdjustRightIndent = True
.DisableLineHeightGrid = False
.FarEastLineBreakControl = True
.WordWrap = True
.HangingPunctuation = True
.HalfWidthPunctuationOnTopOfLine = False
.AddSpaceBetweenFarEastAndAlpha = True
.AddSpaceBetweenFarEastAndDigit = True
.BaseLineAlignment = wdBaselineAlignAuto
End With
ActiveDocument.Styles(wdStyleHeading2).NoSpaceBetweenParagraphsOfSameStyle = False
With ActiveDocument.Styles(wdStyleHeading2)
.AutomaticallyUpdate = False
.BaseStyle = wdStyleNormal
.NextParagraphStyle = wdStyleNormal
End With
'新建 圖片樣式 判斷是否存在
On Error Resume Next ' 暫時(shí)禁用錯(cuò)誤處理
styleExists = Not (ActiveDocument.Styles("圖片樣式") Is Nothing)
On Error GoTo 0 ' 恢復(fù)正常的錯(cuò)誤處理
If Not styleExists Then
ActiveDocument.Styles.Add Name:="圖片樣式", Type:=wdStyleTypeParagraph
End If
ActiveDocument.Styles("圖片樣式").AutomaticallyUpdate = True
With ActiveDocument.Styles("圖片樣式").Font
.NameFarEast = "宋體"
.NameAscii = "Times New Roman"
.NameOther = "Times New Roman"
.Name = "Times New Roman"
.Size = 10.5
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Scaling = 100
.Kerning = 1
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.Ligatures = wdLigaturesNone
.NumberSpacing = wdNumberSpacingDefault
.NumberForm = wdNumberFormDefault
.StylisticSet = wdStylisticSetDefault
.ContextualAlternates = 0
End With
With ActiveDocument.Styles("圖片樣式").ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphCenter
.WidowControl = False
.KeepWithNext = True
.KeepTogether = True
.PageBreakBefore = True
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(0)
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.OutlineLevel = wdOutlineLevelBodyText
.LineUnitBefore = 0
.LineUnitAfter = 0
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
.CollapsedByDefault = False
.AutoAdjustRightIndent = True
.DisableLineHeightGrid = False
.FarEastLineBreakControl = True
.WordWrap = True
.HangingPunctuation = True
.HalfWidthPunctuationOnTopOfLine = False
.AddSpaceBetweenFarEastAndAlpha = True
.AddSpaceBetweenFarEastAndDigit = True
.BaseLineAlignment = wdBaselineAlignAuto
End With
ActiveDocument.Styles("圖片樣式").NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("圖片樣式").ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("圖片樣式").ParagraphFormat
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
With .Borders
.DistanceFromTop = 1
.DistanceFromLeft = 4
.DistanceFromBottom = 1
.DistanceFromRight = 4
.Shadow = False
End With
End With
ActiveDocument.Styles("圖片樣式").Frame.Delete
MsgBox "標(biāo)題正文模板樣式設(shè)置完成"
End Sub
Sub 設(shè)置頁(yè)面參數(shù)2()
'
'設(shè)置初始化:取消所有樣式、設(shè)置頁(yè)邊距、設(shè)置紙張大小、頁(yè)眉頁(yè)腳邊距、每頁(yè)行數(shù)、每行字?jǐn)?shù)、設(shè)置所有段落為正文樣式
'
Selection.WholeStory
Selection.ClearFormatting
Selection.Range.HighlightColorIndex = wdNoHighlight
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(2.54)
.BottomMargin = CentimetersToPoints(2.54)
.LeftMargin = CentimetersToPoints(3.17)
.RightMargin = CentimetersToPoints(3.17)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.5)
.FooterDistance = CentimetersToPoints(1.75)
.PageWidth = CentimetersToPoints(21)
.PageHeight = CentimetersToPoints(29.7)
.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
.CharsLine = 39
.LinesPage = 44
.LayoutMode = wdLayoutModeGrid
End With
' 設(shè)置正文樣式
Selection.Style = ActiveDocument.Styles(wdStyleNormal)
Selection.HomeKey Unit:=wdStory
MsgBox "頁(yè)面參數(shù)樣式設(shè)置完成"
End Sub
Sub 刪除空白行3()
'
'先執(zhí)行刪除空白行(不可等設(shè)置完樣式后再執(zhí)行),再將全文所有空格刪除
'
Dim para As Paragraph
Dim isBlank As Boolean
For Each para In ActiveDocument.Paragraphs
isBlank = True
If Len(para.Range.text) <> 1 Then
isBlank = False
End If
If para.Range.Information(wdWithInTable) = False Then
If isBlank Then
para.Range.Delete
End If
End If
Next
ActiveDocument.Content.Find.Execute FindText:=" ", ReplaceWith:="", Replace:=wdReplaceAll
MsgBox "已刪除所有空白行(非表格內(nèi))、空格"
End Sub
Sub 刪除分頁(yè)符4_1()
'chatgpt生成 需要去了解While .Execute用法、Collapse 等
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Selection.HomeKey Unit:=wdStory
Dim rng As Range
Set rng = ActiveDocument.Content
Dim regEx As Object
Set regEx = CreateObject("VBScript.RegExp")
With regEx
.Global = True
.pattern = "\d+"
End With
With rng.Find
.ClearFormatting
.text = "^m"
.Forward = True
.Wrap = wdFindStop
While .Execute
Dim lineText As String
lineText = rng.Paragraphs(1).Range.text
If regEx.test(lineText) Then
Dim matches As Object
Set matches = regEx.Execute(lineText)
If matches.Count > 0 Then
rng.Paragraphs(1).Range.Delete
End If
End If
rng.Collapse Direction:=wdCollapseEnd
rng.MoveStart Unit:=wdCharacter, Count:=1
Wend
End With
End Sub
Sub 刪除分節(jié)符4_2()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Selection.HomeKey Unit:=wdStory
Dim rng As Range
Set rng = ActiveDocument.Content
Dim regEx As Object
Set regEx = CreateObject("VBScript.RegExp")
With regEx
.Global = True
.pattern = "\d+"
End With
With rng.Find
.ClearFormatting
.text = "^b"
.Forward = True
.Wrap = wdFindStop
While .Execute
Dim lineText As String
lineText = rng.Paragraphs(1).Range.text
If regEx.test(lineText) Then
Dim matches As Object
Set matches = regEx.Execute(lineText)
If matches.Count > 0 Then
rng.Paragraphs(1).Range.Delete
End If
End If
rng.Collapse Direction:=wdCollapseEnd
rng.MoveStart Unit:=wdCharacter, Count:=1
Wend
End With
ActiveDocument.Content.Find.Execute FindText:="^b", ReplaceWith:="", Replace:=wdReplaceAll '刪除分節(jié)符
ActiveDocument.Content.Find.Execute FindText:="^m", ReplaceWith:="", Replace:=wdReplaceAll '刪除分頁(yè)符
End Sub
Sub 刪除分頁(yè)符分節(jié)符4()
Call 刪除分頁(yè)符4_1
Call 刪除分節(jié)符4_2
MsgBox "已刪除所有分頁(yè)符分節(jié)符"
End Sub
Sub 遍歷設(shè)置各級(jí)段落樣式5()
'
'遍歷每個(gè)段落 逐段落進(jìn)行標(biāo)題匹配設(shè)置樣式
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Selection.HomeKey Unit:=wdStory
Dim t2_reg, t3_reg, t4_reg, t5_reg, t6_reg, t7_reg, cankao_reg
Set t2_reg = CreateObject("vbscript.regexp")
t2_reg.pattern = "^(第[一二三四五六七八九十 ]+篇[^\r]*)\r"
Set t3_reg = CreateObject("vbscript.regexp")
Dim para As Paragraph
Dim isSearched As Boolean
Dim pos As Long
For Each para In ActiveDocument.Paragraphs
'用if-elseif更好-不想改了
isSearched = False
If t2_reg.test(para.Range.text) And Not isSearched Then
isSearched = True
para.Style = ActiveDocument.Styles(wdStyleHeading2)
pos = InStr(para.Range.text, "篇") + 1
para.Range.Characters(pos).InsertBefore " " '此段落一定有篇
End If
Next
Selection.HomeKey Unit:=wdStory
MsgBox "遍歷設(shè)置各級(jí)段落樣式完成"
End Sub
Sub 設(shè)置各級(jí)標(biāo)題樣式5()
'不推薦-慢
'采用正則匹配,然后查找設(shè)置對(duì)應(yīng)的段落格式
'https://devbox.cn/p/Zai_vba_Zhong_di_460e0cc1.html(非對(duì)象不使用set,需要提前Dim聲明,對(duì)象需要set,可不Dim聲明)
'可簡(jiǎn)化成1個(gè)函數(shù),傳參遍歷執(zhí)行-但不想!
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim t2_reg, t3_reg, t4_reg, t5_reg, t6_reg, t7_reg, strA$ '最后1個(gè)$ 只對(duì)strA有效
strA = ActiveDocument.Content.text
Set t2_reg = CreateObject("vbscript.regexp")
'二級(jí)標(biāo)題
Selection.HomeKey Unit:=wdStory
t2_reg.pattern = "\r(第[一二三四五六七八九十 ]+篇[^\r]*)\r"
t2_reg.Global = True
Set t2_titles = t2_reg.Execute(strA)
For Each t2_title In t2_titles
With Selection.Find
.ClearFormatting
.text = t2_title.SubMatches(0)
.Execute Forward:=True
End With
Selection.Style = ActiveDocument.Styles(wdStyleHeading2)
Selection.HomeKey Unit:=wdStory
Next
MsgBox "標(biāo)題正文樣式設(shè)置完成"
End Sub
Sub 設(shè)置圖表樣式6()
'
'設(shè)置圖表樣式
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim mytable As Table
For Each mytable In ActiveDocument.Tables
With mytable
.TopPadding = PixelsToPoints(0, True)
.BottomPadding = PixelsToPoints(0, True)
.LeftPadding = PixelsToPoints(0, True)
.RightPadding = PixelsToPoints(0, True)
.Spacing = PixelsToPoints(0, True)
.AllowPageBreaks = True
.AllowAutoFit = True
With .Rows
.WrapAroundText = False
.Alignment = wdAlignRowCenter
.AllowBreakAcrossPages = False
.HeightRule = wdRowHeightExactly
.Height = CentimetersToPoints(0)
.LeftIndent = CentimetersToPoints(0)
End With
With .Range
With .Font
.Name = "宋體"
.Name = "Times New Roman"
.Color = wdColorAutomatic
.Size = 7.5
.Kerning = 0
.DisableCharacterSpaceGrid = True
End With
With .ParagraphFormat
.CharacterUnitFirstLineIndent = 0
.FirstLineIndent = CentimetersToPoints(0)
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphCenter
.AutoAdjustRightIndent = False
.DisableLineHeightGrid = True
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.FirstLineIndent = CentimetersToPoints(0)
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
End With
.Cells.VerticalAlignment = wdCellAlignVerticalCenter
End With
.PreferredWidthType = wdPreferredWidthPoints
.PreferredWidth = CentimetersToPoints(14.5)
With .Borders
.InsideLineStyle = wdLineStyleSingle
.OutsideLineStyle = wdLineStyleSingle
.InsideLineWidth = wdLineWidth025pt
.OutsideLineWidth = wdLineWidth025pt
.InsideColor = wdColorAutomatic
.OutsideColor = wdColorAutomatic
End With
End With
Next
Selection.HomeKey Unit:=wdStory
Dim ishape As InlineShape
For Each ishape In ActiveDocument.InlineShapes
With ishape
If .Type = wdInlineShapePicture Then
.LockAspectRatio = msoTrue
.Width = CentimetersToPoints(14.5)
End If
End With
ishape.Range.Style = ActiveDocument.Styles("圖片樣式")
Next
Dim sh As Shape
For Each sh In ActiveDocument.Shapes
With sh
If .Type = msoPicture Then
.LockAspectRatio = msoTrue
.Width = CentimetersToPoints(14.5)
End If
End With
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.FirstLineIndent = CentimetersToPoints(0)
End With
Next
Selection.HomeKey Unit:=wdStory
MsgBox "圖表樣式設(shè)置完成"
End Sub
Private Sub SetSuperscriptAndSubscript(ByVal PrefixChr As String, ByVal SetChr As String, Optional ByVal PostChr As String, Optional ByVal SuperscriptMode As Boolean = True)
'程序功能:設(shè)置文檔中特定字符為上標(biāo)或下標(biāo)。
'參數(shù)說(shuō)明:
'PrefixChr:必選參數(shù),要設(shè)置為上、下標(biāo)字符之前的字符;
'SetChr:必選參數(shù),要設(shè)置為上、下標(biāo)的字符;
'PostChr:必選,但可賦空字符串,若為了界定整個(gè)替換符號(hào)而包含的后綴,防止誤替換,可加此參數(shù)
'SuperscriptMode:可選參數(shù),設(shè)置為 True 表示將 SetChr 設(shè)置為上標(biāo),設(shè)置為 False 表示將 SetChr 設(shè)置為下標(biāo),默認(rèn)為 True。
Selection.Start = ActiveDocument.Paragraphs(1).Range.Start
Selection.Collapse wdCollapseStart
With Selection.Find
.ClearFormatting
.MatchCase = False
.Replacement.ClearFormatting
.text = PrefixChr & SetChr & PostChr
.Replacement.text = .text
If SuperscriptMode Then
.Replacement.Font.Superscript = True
Else
.Replacement.Font.Subscript = True
End If
.Execute Replace:=wdReplaceAll
.ClearFormatting
.Replacement.ClearFormatting
.text = PrefixChr
If SuperscriptMode Then
.Font.Superscript = True
Else
.Font.Subscript = True
End If
.Replacement.text = .text
If SuperscriptMode Then
.Replacement.Font.Superscript = False
Else
.Replacement.Font.Subscript = False
End If
.Execute Replace:=wdReplaceAll
If Len(PostChr) > 0 Then
.ClearFormatting
.Replacement.ClearFormatting
.text = PostChr
If SuperscriptMode Then
.Font.Superscript = True
Else
.Font.Subscript = True
End If
.Replacement.text = .text
If SuperscriptMode Then
.Replacement.Font.Superscript = False
Else
.Replacement.Font.Subscript = False
End If
.Execute Replace:=wdReplaceAll
End If
End With
End Sub
Sub 執(zhí)行上下標(biāo)7()
'
'依靠SetSuperscriptAndSubscript來(lái)實(shí)現(xiàn)
'
Call SetSuperscriptAndSubscript("O", "+", "", True)
Call SetSuperscriptAndSubscript("O", "-", "", True)
Call SetSuperscriptAndSubscript("H", "2", "O", False)
Call SetSuperscriptAndSubscript("TiO", "2", "", False)
MsgBox "設(shè)置上下標(biāo)完成"
End Sub
Sub 數(shù)字智能自動(dòng)排版流程_遍歷段落()
MsgBox "這種遍歷更快更好-磊磊"
Call 設(shè)置標(biāo)題正文模板樣式1
Call 設(shè)置頁(yè)面參數(shù)2
Call 刪除空白行3
Call 刪除分頁(yè)符分節(jié)符4
Call 遍歷設(shè)置各級(jí)段落樣式5
Call 設(shè)置圖表樣式6
Call 執(zhí)行上下標(biāo)7
MsgBox "已全部設(shè)置完成-磊磊"
End Sub
到了這里,關(guān)于word vba自動(dòng)化排版-設(shè)置標(biāo)題模板樣式、標(biāo)題、正文、圖表、頁(yè)面、上下標(biāo)等設(shè)置、刪除空白行、刪除分頁(yè)符分節(jié)符、刪除空格等的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!