
VBA
Dim rngFormat As Range
Set rngFormat = ActiveDocument.Range(Start:=0, End:=0)

word
.InsertAfter Text:=dzwebs
.InsertParagraphAfter
With .Font
.Name = 隶书
.Size = 36
.Bold = True
End With
End With
With ActiveDocument.Paragraphs(1)
.Alignment = wdAlignParagraphCenter
.SpaceAfter = InchesToPoints(0.5)
End With
部分代码解释:
Dim rngFormat As Range定义变量
Set rngFormat = ActiveDocument.Range(Start:=0, End:=0)设置rngFormat变量的位置,位于文档的最上面
With rngFormat
里面的代码功能是设置字体字号等属性
End With
With ActiveDocument.Paragraphs(1)
.Alignment = wdAlignParagraphCenter
.SpaceAfter = InchesToPoints(0.5)
End With
该代码代码功能是添加段后距离为0.5英寸
Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号