专利说明书在撰写时,如遇到附图标记过多时,往往需要手动替换各部件以增加附图标记,较为耗时,通过下述代码可对文中的所有部件快速标记,通常只需几秒。
Sub 自动增加附图标记()
Dim fea(0 To 9, 0 To 9, 0 To 9) As String
i = 1
Do
With Selection.find
.Text = "[!0-9]" & i & "[!^1-^127]"
.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.find.Execute
If Selection.find.Found And i <= 9 Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
fea(i, 0, 0) = Selection.Text
i = i + 1
Else: i = i + 1
End If
If i = 10 Then
Exit Do
End If
Loop
i = 1
j = 1
Do
With Selection.fin