word编号格式“图 一

您所在的位置:网站首页 word2007标题自动编号 word编号格式“图 一

word编号格式“图 一

2023-08-12 02:57| 来源: 网络整理| 查看: 265

一、使用插件——论文抽屉

官网:毕业论文模板|学位论文模板|论文模板|图加软件「论文抽屉」-主页 (tujiastudio.com)

优点:国产,对于域的操作很方便;缺点:需要付费使用;

二、编辑域——使用 宏 

原理见:编号格式“图一.1”改为“图1.1”编号以阿拉伯数字显示 - 懵懂的菜鸟 - 博客园 (cnblogs.com)

这里只是将上述原理使用 宏 实现自动操作,先上代码:

Sub 题注正则替换() ' ' 题注正则替换 宏 ' ' ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _ PreserveFormatting:=False Selection.TypeText Text:="SEQ seq \h" Selection.MoveRight Unit:=wdCharacter, Count:=2 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^d SEQ seq \c" .Replacement.Text = "SEQ seq \c" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "SEQ seq \c-" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "STYLEREF 1 \s" .Replacement.Text = "SEQ seq \c" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes Selection.WholeStory Selection.Fields.Update End Sub Sub 题注正则替换【更新】() ' ' 题注正则替换【更新】 宏 ' ' ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _ PreserveFormatting:=False Selection.TypeText Text:="SEQ seq \h" Selection.MoveRight Unit:=wdCharacter, Count:=2 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^d SEQ seq \c" .Replacement.Text = "SEQ seq \c" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "SEQ seq \c-" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "STYLEREF 1 \s" .Replacement.Text = "SEQ seq \c" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes Selection.WholeStory Selection.Fields.Update End Sub

食用方法:

        1. 创建宏,将上述代码分别创建宏;

        2. 将光标移至一级标题末尾,运行“题注正则替换”;

→结果:

        3. 插入新图片后,将光标移至一级标题末尾,运行“题注正则替换【更新】”;

→结果:



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3