Dim bContinue As Boolean }iKjef#J
>niv>+!N
Dim regEX As New RegExp 8D)1ZUx7`
Dim paraCounter As Long '全局段落计数,仅在主程序中可读写,其它过程函数应为只读 sf2%WPK
8/>.g.]
Dim LastTitle0String As String, LastTitle0No As Long ;l!<A
Dim LastTitle1String As String, LastTitle1No As Long m
OUO)[6y
Dim LastTitle2String As String, LastTitle2No As Long zp8x/,gwF
Dim LastTitle3String As String, LastTitle3No As Long V$hL\`e
Dim LastTitle4String As String, LastTitle4No As Long }o:LwxNO
Dim LastTitle5String As String, LastTitle5No As Long #,z-Pj?O!
Dim LastTabelString As String, LastTableNo As Long cVx SO`jZw
Dim LastFigureString As String, LastFigureNo As Long KMi$0+
jz"
>Kh.}
Dim strSeperator As String AwG0E`SU
[;ZCq!)>
Sub ConvertWidth(fTEXT As String, rText As String) 8i[TeW"
Selection.Find.ClearFormatting ]^"Lc~w8&
Selection.Find.Replacement.ClearFormatting @H`jDaB9
Selection.Find.Wrap = wdFindContinue P0m9($JBD
Me.txtStatus.Text = "转换全角数字字母" & fTEXT & "形式为半角" & rText |*t 2IVwX
DoEvents S~:uOm2t\
Selection.Find.Execute findtext:=fTEXT, replacewith:=rText, Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue, MatchCase:=True
zlEI_th:~
End Sub g "Du]_,
yQ/O[(
Sub ClearDomain() X8m-5(uW
With Selection.Find VLm\P S
.ClearFormatting [4#HuO@h
.Replacement.ClearFormatting GkU_01C
.Wrap = wdFindContinue &UH0Tw4
Me.txtStatus.Text = "清除所有域代码" q`p0ul,n
DoEvents me2vR#
.Execute findtext:="^d", replacewith:="", Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue, MatchWildcards:=False 4eB'mPor
End With @@*x/"GJG
End Sub 4)e1K/PJ)
K@=
u F1?
Private Sub cmdCheck_Click() n`Z}tQ%)o
bContinue = True 82,^Pu
Dim NoSeries1(1 To 16) As String X[.%[G|oj}
Dim NoSeries2(1 To 16) As String \Ebh6SRp\
Dim NoSeries5(1 To 16) As String 9 RDs`>v
Dim NoSeriesRM(1 To 16) As String By6O@ .\V
Dim paraTotal As Long, ParaText As String 1P"7.{
Dim ttString As String, ttNo As String Zocuc"j
AsE77AUA
Dim ShapeCounter As Long, ShapeHeight As Long, ShapeWidth As Long #EUT"^:d
J\+fkN<.
Me.txtStatus.Visible = True wA$?e}
Me.lbParaType.Visible = True qZ!kVrmg&
Me.cmdCheck.Enabled = False r4P%.YO+X
ng+sK
T&[6
R5e[cC8o
.
L@O>;zp;
Dim ParaType As String, rText As String mQ1
C<teZz8/w
Selection.WholeStory ;!f~
Selection.NoProofing = True H^kOwmSzh
c&bhb[
tm1 = Now KC}G_"f.$
*-=/"
m
ActiveWindow.View.Type = wdNormalView jo&j<3i
J=Kv-@I>E
NoSeries1(1) = "一" f4pIF"U9>
NoSeries1(2) = "二" .
t[u_tBL
NoSeries1(3) = "三" %pjY ^tM/
NoSeries1(4) = "四" =LLpJ+
NoSeries1(5) = "五" F1BvDplQ>G
NoSeries1(6) = "六" fLs>|Rh
NoSeries1(7) = "七" fUf1G{4
NoSeries1(8) = "八" Vq0X:<9
NoSeries1(9) = "九" I N3-ZNx
NoSeries1(10) = "十" ZhCd**
NoSeries1(11) = "十一" N<SW
$ o
NoSeries1(12) = "十二" pmBN?<
NoSeries1(13) = "十三" ! xM=7Q
k
NoSeries1(14) = "十四" j_,/U^Ws|f
NoSeries1(15) = "十五" !x-__[#
NoSeries1(16) = "十六" I*%3E.Z@g
=_=%1rI~
NoSeries2(1) = "㈠" OP+*%$wR
NoSeries2(2) = "㈡" KKk~vwW
NoSeries2(3) = "㈢" axmq/8X
NoSeries2(4) = "㈣" u\ 7Y
_`8
NoSeries2(5) = "㈤" Z{vc6oj
NoSeries2(6) = "㈥" 1v:Ql\^cT
NoSeries2(7) = "㈦" Q^va+O
NoSeries2(8) = "㈧" TI8\qI
W
NoSeries2(9) = "㈨" 6t7FklM%
NoSeries2(10) = "㈩" .Bkfe{^
lS Y "
NoSeries5(1) = "①" ZFMO;'m&
NoSeries5(1) = "②" L
*\[;.mk
NoSeries5(3) = "③" 'V%w{ZiiV
NoSeries5(4) = "④" %?n=In(F
NoSeries5(5) = "⑤" CC^]Y.9
NoSeries5(6) = "⑥" k(Xs&f
`
NoSeries5(7) = "⑦" C+t3a@&|
NoSeries5(8) = "⑧" >y8>OJ?A7-
NoSeries5(9) = "⑨" Y.I~.66s
NoSeries5(10) = "⑩" 4r_*: $g
4 ;_g9]
y(<{ e~
NoSeriesRM(1) = "I" e%pohHI
NoSeriesRM(2) = "II" ~m<K5K6 V
NoSeriesRM(3) = "III" V?yQm4
NoSeriesRM(4) = "IV" =U~53Tg
NoSeriesRM(5) = "V" H.iCYD_=
NoSeriesRM(6) = "VI" &V
7J5~_
NoSeriesRM(7) = "VII" g4q{
]
NoSeriesRM(8) = "VIII" f{2UL ?y
NoSeriesRM(9) = "IX" vbJdhaf
NoSeriesRM(10) = "X" <v9IK$J
NoSeriesRM(11) = "XI" #Q
sJr_=
NoSeriesRM(12) = "XII" %`pi*/(
NoSeriesRM(13) = "XIII" xKBi".wA
NoSeriesRM(14) = "XIV" u= dj3q
NoSeriesRM(15) = "XV" Kn$t_7AF^
NoSeriesRM(16) = "XVI" W2-l_{
5q@s6_"{
i = MsgBox("为了你的数据安全,请使用单独保存的文件副本进行本操作。" & vbCrLf & "确定继续进行吗?", vbYesNo) *>?N>f"
G)YmaHeI;[
If i = vbNo Then PdVY tK%
Exit Sub ncadVheKt
End If pvl];w
;\}dQsX
If Me.chkSuper.Value Then !L;_
f'\)6
Me.txtStatus.Text = "检查修改所有的上标格式" E8PwA.
VTR4uT-
CheckSuperScript lFf>z}eLy
mEYfsO
End If au1
9Q*r9
Ln6emXqw
If Me.chkStyle.Value Then `0%;Gz%}
Me.txtStatus.Text = "设置样式,请稍候...." "4xo,JUf
DoEvents 0x5\{f
CeateOrModifyStyle XBX`L"0
End If
).GM0-y
4
/{pz$
Ie!">8."
lE%
KzX?&
ClearDomain :55a9d1bL
Chl^LEN:
t
c.|mIvw
13 L&f\b
If Me.chkLIST.Value Then 9ec
?L
Me.txtStatus.Text = "将所有自动列表标题转化为人工标题形式" jQ7;-9/~N
>q?{'#i
/
ConvertListToOrdinary %VB4/~ "
End If h3E}Sa(MQ:
+fM8
;~r- P$kCY
Dim pType As String, trimpTEXT As String 7Oe$Ou
If Me.chkNum.Value = True Then AW\uE[kg
Me.txtStatus.Text = "转换全角数字形式为半角" }s?w-u+(c6
ConvertWidth "1", "1" SN")u
DoEvents VDv.N@)7
ConvertWidth "2", "2" |1H9,:*%
DoEvents \c{sG\ >
ConvertWidth "3", "3" 28M^F~0
DoEvents o3Yb2Nw
ConvertWidth "4", "4" /+B6oE>8
DoEvents _~tF2`,Y_p
ConvertWidth "5", "5" H(Wiy@cJn
DoEvents kz}Bc
F
ConvertWidth "6", "6" 416}# Mk
DoEvents X!6dg.n5
ConvertWidth "7", "7" s+_8U}R
DoEvents }LS.bQKqi,
ConvertWidth "8", "8" 8[,R4@
DoEvents -]}#Z:&
ConvertWidth "9", "9" 6qmV/DL
DoEvents P//nYPyzg
ConvertWidth "0", "0" XySkm2y
DoEvents %OHWGac"i
ConvertWidth "a", "a" (bsywM
DoEvents pk'd&.
ConvertWidth "b", "b" I
m-M2n
DoEvents #a@ jt
ConvertWidth "c", "c" %j@/Tx/
DoEvents L Y4bn)Qf
ConvertWidth "d", "d" 0iC5,
DoEvents cGo_qR/B(>
ConvertWidth "e", "e" e]>=;Zn
DoEvents P()n=&XO6
ConvertWidth "f", "f" n|T$3j)
DoEvents _IEbRVpb
ConvertWidth "g", "g" % &H^UxC
DoEvents y+$vHnS/jC
ConvertWidth "h", "h" @6|0H`kv
DoEvents @\gE{;a8
ConvertWidth "i", "i" )@U~Li/+
DoEvents pUmT?N!
ConvertWidth "j", "j" %AqI'ObC
DoEvents /g%RIzgW
ConvertWidth "k", "k" E0HE@pqr
DoEvents vMX\q
ConvertWidth "l", "l" /Dc54Un
DoEvents +B8oW3v# )
ConvertWidth "m", "m" n(LO`{
DoEvents U7/
=|Z
ConvertWidth "n", "n" ;B2kot7
ConvertWidth "o", "o" _
qOynW
ConvertWidth "p", "p" Nf* .r
ConvertWidth "q", "q" ro?.w
ConvertWidth "r", "r" =Gj~:|;$
ConvertWidth "s", "s" F@ pf._c
ConvertWidth "t", "t" pHoxw|'Y
ConvertWidth "u", "u" RWu<
dY#ym
ConvertWidth "v", "v" |;aZi?Ek[
ConvertWidth "w", "w" {C?$osrr
ConvertWidth "x", "x" .L^j:2(L
ConvertWidth "y", "y" jp}.W
ConvertWidth "z", "z" N0$
uB"
ConvertWidth "A", "A" w(S&X"~
ConvertWidth "B", "B" =^ Ws/k
ConvertWidth "C", "C" uk
WL3
ConvertWidth "D", "D" 7)O+s/.P)
ConvertWidth "E", "E" uF3{FYM{I
ConvertWidth "F", "F" Q$:,N=%
ConvertWidth "G", "G" B
k\KG
ConvertWidth "H", "H" iu{;|E
ConvertWidth "I", "I" GHLFn~z@XJ
ConvertWidth "J", "J" q~iEw#0-L
ConvertWidth "K", "K" AK'3N1l`
ConvertWidth "L", "L" BuAzO>=
ConvertWidth "M", "M" bhg6p$411
ConvertWidth "N", "N" F#Pn]
ConvertWidth "O", "O" QCDica `+*
ConvertWidth "P", "P" 4/\Ynb.L
ConvertWidth "Q", "Q" Je"XIhBr
ConvertWidth "R", "R" o[JZ>nm
ConvertWidth "S", "S" &\5bo=5V
ConvertWidth "T", "T" N|"q6M!ZL
ConvertWidth "U", "U" FncP,F$8
ConvertWidth "V", "V" vd^Z^cpip
ConvertWidth "W", "W" E.N>,N
ConvertWidth "X", "X" "5$p=|
ConvertWidth "Y", "Y" ub1~+T'O
ConvertWidth "Z", "Z" o,_F;ZhE
ConvertWidth "^l", "^p" #/9Y}2G|]
ConvertWidth "(", "(" <WmjjD
ConvertWidth ")", ")" <jFov`^
F 3q<j$y
End If *yZta:(w-W
.*595SuF
With ActiveDocument dpge:Qhr
Dim tbl As Table MVQ6I/EA4
For Each tbl In .Tables Kx[+$Qt
tbl.Rows.Alignment = wdAlignRowCenter {@x-T
tbl.Range.Font.NameFarEast = "楷体" zmuRn4Nv
tbl.Range.Font.NameAscii = "Times New Roman" i
*4v!(E
tbl.Range.Font.Size = 10.5 1S+T:n
Next XmVst*2=
Set tbl = Nothing
\
%]lsml
End With Y>E` 7n
.!2
u#A
#jxPh!%9
With ActiveDocument 41.xi9V2
.bV^u
For i = 1 To .TablesOfContents.Count Q>\DM'{:4
.TablesOfContents(i).Delete v13\y^t
Next FW3E UC)P
d7&d
FvG
6_rgRo&
R;U4a2~
paraTotal = .Paragraphs.Count e8_EB/)_Z
paraCounter = 1 j~+(#|
I3Z\]BI
LastTitle0No = 0 `x# }co
LastTitle1No = 0 i-WP#\s
LastTitle2No = 0 |_s,]:
LastTitle3No = 0 C[ KMaB
LastTitle4No = 0 (VC Jn<@@
LastTableNo = 0 .DnG}884
LastFigureNo = 0 }a UQ#x
9&kPcFX B
Dim Sec As Long
(<Cg|*s
XdlA)0S)
Sec = InputBox("正文从第一节开始?", "节设置", 6) pfl^GgP#
If Sec = 0 Then tK+JmbB\
Exit Sub [z_ztK1
End If #{k+^7aQ
M0vX9;J
k = 0 \Q|,0`
Do While (paraCounter < paraTotal) And bContinue u]9 #d^%V
k = k + 1 d}?KPJ{
If .Paragraphs(paraCounter).Range.Information(wdActiveEndSectionNumber) >= Sec Then ,N_V(Cx5pt
Exit Do Jfv'M<I
End If X
g7xy>{]
paraCounter = paraCounter + 1 6>&(OV
If k Mod 20 = 0 Then "~K ph0-
Me.lbCounter.Caption = paraCounter PRyzvc~
DoEvents |XQ\c.A
End If ns/*WH&[x
Loop m^RO*n.
`4Z:qh+fJ
*cXi*7|=
Do While (paraCounter < paraTotal) And bContinue 0;
w 4WJJ
z}
r
ParaText = Trim(.Paragraphs(paraCounter).Range.Text) Y2ON!Rno
ShapeHeight = 0 hDoFF8)c
ShapeWidth = 0 <O-R
\SgBI/L^
CheckPara .Paragraphs(paraCounter).Range, ParaType, rText, ttString, ttNo, ShapeCounter, ShapeHeight, ShapeWidth 4`V&Yqwl
j,i)
ecZ>
Select Case ParaType J*%IvRg
Case "【】表格内容" "9 vL+Hh
.Paragraphs(paraCounter).Style = "QLNU表格内容" Gp?pSI,b.t
Case "章" &`]T#">
LastTitle0No = LastTitle0No + 1 vy-(:aH7U
'新一章开始,复位其下属标题编号 :UKc:JVNM
LastTitle1No = 0 X}QcXc.d
LastTitle2No = 0 }U}ppq0Eo
LastTitle3No = 0
z-]ND
LastTitle4No = 0 j39"iAn
]_!NmB_3
k = Val(ttNo) 931GJA~g
If k = 0 Then '非数字编号章节 w&hCt