word 自动插入题注

将以下代码插入到vb宏中运行,即可实现自动插入题注。

Sub 题注()
' 题注 宏
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p图^#"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.InsertCaption Label:="图", TitleAutoText:="InsertCaption4", Title _
:="", Position:=wdCaptionPositionBelow, ExcludeLabel:=0
End Sub

如需清理题注内原有的手动标签,请依次替换"图^#^#"和"图^#",同时查找的样式需要设置为"题注"。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>