2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > word 宏 图全部自动设置插入题注

word 宏 图全部自动设置插入题注

时间:2021-04-16 05:10:19

相关推荐

word 宏 图全部自动设置插入题注

图 本来就具有图几的编号

Sub 自动添加图片题注()

'

' 自动添加图片题注 宏

'

'

'图片自动编号 宏

'主要由引用中的插入题注完成,再在编号与说明文字间输入2个空格,然后再将光标点移动两个空格之前,通过查找其之前的空格符,找到就删除题注与编号间的空格

'

Selection.HomeKey Unit:=wdStory

Do Until ActiveDocument.Bookmarks("\Sel") = ActiveDocument.Bookmarks("\EndOfDoc")

Selection.GoTo What:=wdGoToGraphic, Which:=wdGoToNext, Count:=1, Name:=""

Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=True

If Selection.Type = 7 Then

'Selection.Collapse wdCollapseStart

'Selection.TypeText Text:="TEST"

'Selection.MoveRight unit:=wdWord, Count:=1, Extend:=False

Selection.InsertCaption Label:="图", TitleAutoText:="InsertCaption1", Title _

:="", Position:=wdCaptionPositionBelow, ExcludeLabel:=0

Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=True

Selection.TypeBackspace

Selection.MoveRight Unit:=wdWord, Count:=2, Extend:=True

Selection.TypeBackspace

Else

Exit Sub

End If

Loop

'

' Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend

'

' Selection.InsertCaption Label:="图", TitleAutoText:="InsertCaption2", Title _

' :="", Position:=wdCaptionPositionBelow, ExcludeLabel:=0

' Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

End Sub

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。