Dim bContinue As Boolean
Rue|<d1 C;:L~)C@t Dim regEX As New RegExp
|aAWWd5 Dim paraCounter As Long '全局段落计数,仅在主程序中可读写,其它过程函数应为只读
-<JBKPtA HmB[oH"x Dim LastTitle0String As String, LastTitle0No As Long
EZumJ." Dim LastTitle1String As String, LastTitle1No As Long
lc?mKW9 Dim LastTitle2String As String, LastTitle2No As Long
VN-#R=D Dim LastTitle3String As String, LastTitle3No As Long
s_Oh >y?Aq Dim LastTitle4String As String, LastTitle4No As Long
m
?% H<4X Dim LastTitle5String As String, LastTitle5No As Long
3]OP9!\6 Dim LastTabelString As String, LastTableNo As Long
q&dRh Dim LastFigureString As String, LastFigureNo As Long
nk|N.%E D6)Cjc>a Dim strSeperator As String
7e{X$' jl-Aos"/ Sub ConvertWidth(fTEXT As String, rText As String)
+ >gbZ-S Selection.Find.ClearFormatting
L[Yp\[#-q Selection.Find.Replacement.ClearFormatting
W%9K5(e Selection.Find.Wrap = wdFindContinue
@))}\: Me.txtStatus.Text = "转换全角数字字母" & fTEXT & "形式为半角" & rText
K0RYI69_ DoEvents
])j|<
W/ Selection.Find.Execute findtext:=fTEXT, replacewith:=rText, Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue, MatchCase:=True
ka)LK@p6 End Sub
^!p<zZ X>Xp&o Sub ClearDomain()
:`u&TXsu With Selection.Find
Y!1^@;)^ .ClearFormatting
jvc?hUcLKT .Replacement.ClearFormatting
UtBlP+bE?y .Wrap = wdFindContinue
VIYksv
Me.txtStatus.Text = "清除所有域代码"
'
ra B DoEvents
3s_k>cO= .Execute findtext:="^d", replacewith:="", Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue, MatchWildcards:=False
G1;'nwf} End With
Pn'(8bRm End Sub
Xm=^\K3 avt>saR Private Sub cmdCheck_Click()
ml33qXW: bContinue = True
&*]{"^ Dim NoSeries1(1 To 16) As String
j YIV^o 0 Dim NoSeries2(1 To 16) As String
_[vdY|_ Dim NoSeries5(1 To 16) As String
H;*a:tbxO+ Dim NoSeriesRM(1 To 16) As String
Tb0;Mbr Dim paraTotal As Long, ParaText As String
mn; 7o~4 Dim ttString As String, ttNo As String
H(G^O&ppdB eMl]td rI Dim ShapeCounter As Long, ShapeHeight As Long, ShapeWidth As Long
u ?G\b{$m n]C%(v!u3 Me.txtStatus.Visible = True
y.*=Ww+ Me.lbParaType.Visible = True
P`3s\8[Q Me.cmdCheck.Enabled = False
8Z4?X% KjwY'aYwr: Cs[7% j
&QOWW} -Mi}yi Dim ParaType As String, rText As String
<.=#EV^i
q]i(CaKh Selection.WholeStory
H(NT| Selection.NoProofing = True
<V:<x k#
Ez tm1 = Now
AXh3LA qM1)3.)[: ActiveWindow.View.Type = wdNormalView
(4/]dTb Jm(&G NoSeries1(1) = "一"
zdjM%l); NoSeries1(2) = "二"
!`
M;# NoSeries1(3) = "三"
}EedHS NoSeries1(4) = "四"
"?eH=! NoSeries1(5) = "五"
>4|c7z4 NoSeries1(6) = "六"
[71#@^ye NoSeries1(7) = "七"
kBiBXRt NoSeries1(8) = "八"
h-b5 NoSeries1(9) = "九"
x*R8^BA]pR NoSeries1(10) = "十"
*L;pc g8{ NoSeries1(11) = "十一"
)}Rfa}MD NoSeries1(12) = "十二"
(
ztim NoSeries1(13) = "十三"
P7wqZ? NoSeries1(14) = "十四"
L;--d`[ NoSeries1(15) = "十五"
wsJ%*
eYf NoSeries1(16) = "十六"
MB8SB 7moElh v NoSeries2(1) = "㈠"
,bVS.A'o NoSeries2(2) = "㈡"
^?s~Fk_V NoSeries2(3) = "㈢"
~6-"i0k
NoSeries2(4) = "㈣"
TXJY2J*24 NoSeries2(5) = "㈤"
N$,/Q9h^ NoSeries2(6) = "㈥"
Z`oaaO NoSeries2(7) = "㈦"
lsB9;I^+x NoSeries2(8) = "㈧"
u
JQaHL! NoSeries2(9) = "㈨"
O\4+_y NoSeries2(10) = "㈩"
iJZ|[jEDV @k+%y'Y? NoSeries5(1) = "①"
Kl aZZJ NoSeries5(1) = "②"
lLkmcHu NoSeries5(3) = "③"
ne"?90~ NoSeries5(4) = "④"
5qd_>UHp NoSeries5(5) = "⑤"
ckf<N9 NoSeries5(6) = "⑥"
o4/I1Mq NoSeries5(7) = "⑦"
KZrMf77= NoSeries5(8) = "⑧"
5i4V 5N>3 NoSeries5(9) = "⑨"
$W/+nmb)@K NoSeries5(10) = "⑩"
4z9#M;qT i[2bmd!H aVQSN NoSeriesRM(1) = "I"
=CjNtD2] NoSeriesRM(2) = "II"
.L^pMU+!^ NoSeriesRM(3) = "III"
A{aw<
P|+ NoSeriesRM(4) = "IV"
YXX36 NoSeriesRM(5) = "V"
<g3du~ NoSeriesRM(6) = "VI"
YA"Ti9-EV NoSeriesRM(7) = "VII"
&SjHrOG? NoSeriesRM(8) = "VIII"
UR1JbyT NoSeriesRM(9) = "IX"
+^4BO` NoSeriesRM(10) = "X"
S$jV|xKB NoSeriesRM(11) = "XI"
8R\>FNk; NoSeriesRM(12) = "XII"
r:c@17 NoSeriesRM(13) = "XIII"
tM^;
?HL] NoSeriesRM(14) = "XIV"
*^@#X-NG NoSeriesRM(15) = "XV"
Qst
\b8, NoSeriesRM(16) = "XVI"
<Qcex3 =sE2}/g i = MsgBox("为了你的数据安全,请使用单独保存的文件副本进行本操作。" & vbCrLf & "确定继续进行吗?", vbYesNo)
RG l=7^M JQ"`9RNb If i = vbNo Then
Y^f94s:2S Exit Sub
?E+:]j_ End If
ePq13!FC/ .# 6n If Me.chkSuper.Value Then
-t@y\vZF, Me.txtStatus.Text = "检查修改所有的上标格式"
g
V"qV Q e>i{:N CheckSuperScript
G`]v_`> (# 6<k End If
Sa;<B
:| |*tWF!
D6` If Me.chkStyle.Value Then
11)/] ?/j Me.txtStatus.Text = "设置样式,请稍候...."
@K$VV^wp DoEvents
$hjP}- oUX CeateOrModifyStyle
4d^
\l! End If
Lj&1K~U =My}{n[ VqK%^ :DdBn. ClearDomain
Fl_dzh,E +mfe*'AU n+{HNr n#+%!HTh If Me.chkLIST.Value Then
\~@[QGKN Me.txtStatus.Text = "将所有自动列表标题转化为人工标题形式"
qIbg
4uE x"
>W u2 ConvertListToOrdinary
.3lGX`d{ End If
<+AI t .KLm39j( pg~zUOY Dim pType As String, trimpTEXT As String
>~I
xyQp If Me.chkNum.Value = True Then
}+91s'/c Me.txtStatus.Text = "转换全角数字形式为半角"
hWD ! ConvertWidth "1", "1"
bp]^EVx DoEvents
h4CTTe) ConvertWidth "2", "2"
U1,~bO9 DoEvents
n7IL7?!o ConvertWidth "3", "3"
RzA2*]%a DoEvents
~L %Pz0Gg ConvertWidth "4", "4"
4M @oj DoEvents
`fBG~NDw ConvertWidth "5", "5"
$!YKZ0)B'0 DoEvents
V_&GYXx(J ConvertWidth "6", "6"
-{X<*P4p DoEvents
vKNt$]pm= ConvertWidth "7", "7"
kmm DoEvents
0jxO |N2) ConvertWidth "8", "8"
.i {>Z DoEvents
I1Hw"G"& ConvertWidth "9", "9"
<<
3
a<I DoEvents
)7&42>t ConvertWidth "0", "0"
DtzA$|Q} DoEvents
_ PXG AS ConvertWidth "a", "a"
uY^v"cw/F DoEvents
hLb;5u&!kW ConvertWidth "b", "b"
xS6(K DoEvents
B{7Kzwh; ConvertWidth "c", "c"
\Fj5v$J- DoEvents
lGdM80f ConvertWidth "d", "d"
"?apgx 6 DoEvents
p91`<>Iw ConvertWidth "e", "e"
Guk.,}9 DoEvents
KX?o
n sZ ConvertWidth "f", "f"
Vbg10pV0 DoEvents
3iE-6udCS ConvertWidth "g", "g"
%55@3)V8Rf DoEvents
j/)"QiS*? ConvertWidth "h", "h"
ZCy`2Fir DoEvents
_W)`cr ConvertWidth "i", "i"
&w+;N5}3 DoEvents
+kjzn]}f ConvertWidth "j", "j"
-1qZqU$h DoEvents
51I|0ly ConvertWidth "k", "k"
}JRP,YNh DoEvents
hi!L\yi ConvertWidth "l", "l"
01U
*_\ DoEvents
:GU,EDps ConvertWidth "m", "m"
-Y*VgoK% DoEvents
j?EskT6 ConvertWidth "n", "n"
&qJPwO ConvertWidth "o", "o"
.z=U= _e ConvertWidth "p", "p"
06 QU ConvertWidth "q", "q"
Zimh_ ConvertWidth "r", "r"
"pt+Fe|@c; ConvertWidth "s", "s"
duX0Mc.0P ConvertWidth "t", "t"
P!
kw;x ConvertWidth "u", "u"
16"#i ConvertWidth "v", "v"
2Y400 ConvertWidth "w", "w"
kTnOmAw ConvertWidth "x", "x"
yiiyqL*E ConvertWidth "y", "y"
cVO
,~I\\ ConvertWidth "z", "z"
s K+
(v ConvertWidth "A", "A"
Lltc4Mzw ConvertWidth "B", "B"
pv$mZi4i ConvertWidth "C", "C"
&^V~cJ ConvertWidth "D", "D"
b,nn&B5@{ ConvertWidth "E", "E"
t?gJNOV ConvertWidth "F", "F"
U?gl"6x ConvertWidth "G", "G"
q`XW5VV{K ConvertWidth "H", "H"
41u*w2j ConvertWidth "I", "I"
<&4nOt ConvertWidth "J", "J"
l B1# ConvertWidth "K", "K"
B\\6# ConvertWidth "L", "L"
>;
aCf#q ConvertWidth "M", "M"
z< z*Wz ConvertWidth "N", "N"
Aj[?aL ConvertWidth "O", "O"
J.#(gFBBl\ ConvertWidth "P", "P"
!X^Hi=aV ConvertWidth "Q", "Q"
>A-<ZS*N ConvertWidth "R", "R"
s[3
e
=N ConvertWidth "S", "S"
l^.K'Q1~a ConvertWidth "T", "T"
l0I}&,+ ConvertWidth "U", "U"
^NXcLEaP*< ConvertWidth "V", "V"
@.'z* |z ConvertWidth "W", "W"
_`H.h6h ConvertWidth "X", "X"
BR+nL6sU ConvertWidth "Y", "Y"
!RS9%ES_? ConvertWidth "Z", "Z"
z9[[C^C ConvertWidth "^l", "^p"
LH4>@YPGE# ConvertWidth "(", "("
puOC60zI ConvertWidth ")", ")"
7 _`L$<-n C)NC&fV End If
2@v
J Rj^7#,993 With ActiveDocument
*c{wtl@ Dim tbl As Table
COR;e`%, For Each tbl In .Tables
m9Ax\lf tbl.Rows.Alignment = wdAlignRowCenter
8O>}k tbl.Range.Font.NameFarEast = "楷体"
mw_ E&v tbl.Range.Font.NameAscii = "Times New Roman"
3P1&; tbl.Range.Font.Size = 10.5
*n8%F9F Next
F8H'^3`b`U Set tbl = Nothing
:M06 ;:e End With
x<)G( Xe* %m9CdWb=w r#A_RZ2~@ With ActiveDocument
l71gf.4g wu A^'T For i = 1 To .TablesOfContents.Count
!=3Rg-'d1 .TablesOfContents(i).Delete
F!JJ6d53y Next
r!7 Y'| rz6uDJ" cB#nsu> ] /+D^6 paraTotal = .Paragraphs.Count
qz 9tr paraCounter = 1
[]|;qHhC~( ?>af'o: LastTitle0No = 0
Y$g}XN*)E LastTitle1No = 0
x[QZ@rGIW LastTitle2No = 0
f|U0s LastTitle3No = 0
s2FngAM;f LastTitle4No = 0
Z`Pd2VRp LastTableNo = 0
+iy7e6P LastFigureNo = 0
;imRh'-V6 j Fma|y Dim Sec As Long
$$hv
`HE^l h35Hu_c& Sec = InputBox("正文从第一节开始?", "节设置", 6)
ibJHU@l If Sec = 0 Then
@9Q2$ Exit Sub
77V
.["=7 End If
4[TR0bM% qos`!=g? k = 0
Cs
wE Do While (paraCounter < paraTotal) And bContinue
[*)Z!) k = k + 1
K%MW6y If .Paragraphs(paraCounter).Range.Information(wdActiveEndSectionNumber) >= Sec Then
yPV'pT) Exit Do
btH _HE
End If
nU(DYHc+l paraCounter = paraCounter + 1
. V$ps-t If k Mod 20 = 0 Then
V }>n Me.lbCounter.Caption = paraCounter
w1r$='*I DoEvents
ZsZcQj6G, End If
Rs*vm Loop
r[s!F=^
UNDi_6Dy X eoJ$PfT Do While (paraCounter < paraTotal) And bContinue
LvJGvj Gih[i\%Q ParaText = Trim(.Paragraphs(paraCounter).Range.Text)
lv]quloT ShapeHeight = 0
-I":
Z2.fR ShapeWidth = 0
&-%X:~|:X 6 {}JbRNf CheckPara .Paragraphs(paraCounter).Range, ParaType, rText, ttString, ttNo, ShapeCounter, ShapeHeight, ShapeWidth
3NIUW!gr k;I &.H Select Case ParaType
2| B[tt1Z Case "【】表格内容"
n-o3 .Paragraphs(paraCounter).Style = "QLNU表格内容"
3$VxRz) Case "章"
eWvo,4 LastTitle0No = LastTitle0No + 1
|9Yi7. '新一章开始,复位其下属标题编号
Gs
dnf 7 LastTitle1No = 0
QV qK LastTitle2No = 0
!g>
.i` LastTitle3No = 0
*f5l=lDOB LastTitle4No = 0
aQ#qRkI &.Q8Mi
aT k = Val(ttNo)
2Vk\L~K If k = 0 Then '非数字编号章节
>`'O7.R If ttNo <> NoSeries1(LastTitle0No) Then
;;Ds rText = "第" & NoSeries1(LastTitle0No) & ttString
g%xGOA Me.ErrMsg.AddItem "章节编号错误:" & ParaText
>xu[q\:" End If
:m'+tGs Else
N8v'70 If Val(ttNo) <> LastTitle0No Then
B&
Y_2)v rText = "第" & LastTitle0No & ttString
WZZ4]cC Me.ErrMsg.AddItem "章节编号错误:" & ParaText
""{|3XJe End If
wvMW| ~9=aT1S| End If
BI2; ex zP!J/}z '章段落设置
@*MC/fe '字体大小:三号16磅小三号15磅四号14磅小四号12磅五号10.5磅小五号9磅
0:&ZnE}## .Paragraphs(paraCounter).Style = "QLNU章节"
p@YB?#Im .Paragraphs(paraCounter).Range.Select
#z!^<, Selection.EndKey unit:=wdLine
?m0IehI tc = Replace(rText, vbCr, "")
Lq (ZcEKo Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="TC """ & tc & """ \l 1 ", PreserveFormatting:=False
Jq
]:<TQ Case "一级标题"
WKmbNvN^ LastTitle1No = LastTitle1No + 1
|E@djosyC '新一级标题开始,复位其下属标题编号
V-!"%fO.s LastTitle2No = 0
AW,OHSXh6 LastTitle3No = 0
rR,2UZR LastTitle4No = 0
DNkWOY#{ "&~
0T# If ttNo <> NoSeries1(LastTitle1No) Then
6P
n8f rText = NoSeries1(LastTitle1No) & "、" & ttString
'Z&;uv,l Me.ErrMsg.AddItem "一级标题编号错误:" & ParaText
@
O>&5gB1u End If
4v'A\~ZU _q?<at}y ;n6b%,s '一级标题段落设置 格式:一、标题内容
0)!Ll*L!p .Paragraphs(paraCounter).Range.Text = rText
C+{l7QT$t .Paragraphs(paraCounter).Style = "QLNU一级标题"
M+`Hg_#Q .Paragraphs(paraCounter).Range.Select
.>pgU{C
`! Selection.EndKey unit:=wdLine
O7t(,uox3y tc = Replace(rText, vbCr, "")
s%pfkoOY% Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="TC """ & tc & """ \l 1 ", PreserveFormatting:=False
)US:.7A[. Case "二级标题"
&v!WVa? LastTitle2No = LastTitle2No + 1
dQb.BOI)h '新二级标题开始,复位其下属标题编号
|J0Q,F]T LastTitle3No = 0
U__(;
/1; LastTitle4No = 0
@}s$]i$|- q
o 1lj"P If ttNo <> NoSeries1(LastTitle2No) Then
Thr*^0$C rText = "(" & NoSeries1(LastTitle2No) & ")" & ttString
B[5r|d' ErrMsg.AddItem "二级标题编号错误:" & ParaText
!@A#=(4R4 End If
S/ [E8T" X|DO~{-au '二级标题段落设置 格式:(一)、标题内容
%ZP+zhn} .Paragraphs(paraCounter).Range.Text = rText
%Sk@GNI_ .Paragraphs(paraCounter).Style = "QLNU二级标题"
rw7_5l `^9(Ot $ .Paragraphs(paraCounter).Range.Select
RthT\%R Selection.EndKey unit:=wdLine
(08I tc = Replace(rText, vbCr, "")
xJs;v Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="TC """ & tc & """ \l 2 ", PreserveFormatting:=False
LN
2D x3pND Case "三级标题"
Oco YV J LastTitle3No = LastTitle3No + 1
17.x0gW, '新三级标题开始,复位其下属标题编号
=Gk/k}1 LastTitle4No = 0
N_Akmh0D wnLi2k/Dt< If Val(ttNo) <> LastTitle3No Then
27F~(!n rText = LastTitle3No & ". " & ttString
w}R~C
Me.ErrMsg.AddItem "三级标题编号错误:" & ParaText
qTQ!jN 5 BtX63 End If
fyWO '三级标题段落设置 格式:1. 标题内容
os lJC$cy' .Paragraphs(paraCounter).Range.Text = rText
Zm
ogM7B .Paragraphs(paraCounter).Style = "QLNU三级标题"
6
sxffJt
.Paragraphs(paraCounter).Range.Select
;Lm=dd@S
: Selection.EndKey unit:=wdLine
4*.K'(S5fx tc = Replace(rText, vbCr, "")
+;}#B~: Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="TC """ & tc & """ \l 3 ", PreserveFormatting:=False
LPYbHo3fq Case "四级标题"
'CZa3ux LastTitle4No = LastTitle4No + 1
%ir:ASk (b,[C\RBF If Val(ttNo) <> LastTitle4No Then
l`-bFmpA rText = "(" & LastTitle4No & "). " & ttString
llV3ka^! ErrMsg.AddItem "四级标题编号错误:" & ParaText
$_H
` ;6ecrQMw& End If
<#GB[kQa '四级标题段落设置 格式:(1). 标题内容
CSPKP#,B0[ .Paragraphs(paraCounter).Range.Text = rText
KInk^`C/H .Paragraphs(paraCounter).Style = "QLNU四级标题"
<"D=6jqZ .Paragraphs(paraCounter).Range.Select
YC_5YY(k Selection.EndKey unit:=wdLine
jjM\. KL] tc = Replace(rText, vbCr, "")
-u!FOD/ Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="TC """ & tc & """ \l 4 ", PreserveFormatting:=False
8vSse =qy=-j] Case "表格标题"
2lKV#9" LastTableNo = LastTableNo + 1
hw N?/5 {O<l[|Ip
If ttNo <> CStr(LastTableNo) Then
R"MRnr_4K rText = "表" & LastTableNo & ". " & ttString
ENF"c$R ErrMsg.AddItem "表格编号错误:" & ParaText
l7{oi! "1`Oh<={b End If
/walu+]h 1?* '表格名称段落设置 格式:表1. 表格名称
Cxod[$8 .Paragraphs(paraCounter).Style = "QLNU表格标题"
(+<1*5BEkT xe = Replace(rText, vbCr, "")
&UCsBqI
Y .Paragraphs(paraCounter).Range.Select
)Or.; Selection.MoveEnd wdCharacter, -1 '选择范围包括行尾的换行符。
@+F4YJmB?l Selection.Range.Text = xe
2Qp Hvsl_ Selection.EndKey
38DT2<qC Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="XE " & """" & xe & """", PreserveFormatting:=False
%?^6).aEK Rm1A>1a: Case "表格首行"
G0O#/%% .Paragraphs(paraCounter).Style = "QLNU表格首行"
obrl#(\P Case "图片标题"
NLPkh,T: LastFigureNo = LastFigureNo + 1
#rO8K f \#-W
< If ttNo <> CStr(LastFigureNo) Then
&!aAO(g
rText = "图" & LastFigureNo & ". " & ttString
#GDe08rOw ErrMsg.AddItem "表格编号错误:" & ParaText
{j5e9pg1L| +Q=1AXe End If
`U#55k9^5 '图片名称段落设置 格式:图1. 图名称
]
u l$* .Paragraphs(paraCounter).Range.Text = rText
l
{jmlT .Paragraphs(paraCounter).Style = "QLNU图片标题"
r;L>.wl*I .Paragraphs(paraCounter).Range.Select
R" )bDy? Selection.EndKey unit:=wdLine
h_1T,f( xe = Replace(rText, vbCr, "")
[email protected]\#- Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="XE " & """" & xe & """", PreserveFormatting:=False
iy.2A!f^. Case "正文"
*KY=\
%D '正文名称段落设置
:c9U>1`g& .Paragraphs(paraCounter).Style = "QLNU正文"
$N:Vo(* Case "文献条目"
.h&k jD With .Paragraphs(paraCounter)
Y{v(p7pl '.Range.Select
V7G7&' 'Selection.ClearFormatting
9Y>8=#.c '.Range.Find.Execute findtext:=rText, replacewith:=strSeperator 'Replacetext 传回了编号及分隔符部分, 而StrSeperator传回了正确的格式与分隔符如“[15] ”
Y
HSYu .Style = "QLNU参考文献"
joKIrS0y End With
?m$a6'2-,J Case "图表注解"
u]u[(K5F With .Paragraphs(paraCounter)
53-v|'9' .Range.Font.NameFarEast = "楷体"
a22Mufl .Range.Font.NameAscii = "Times New Roman"
8t@p@Td| .Range.Font.Size = 9 '小5号字
T,xPSN2A* ]?x:
Qm'yo .Alignment = wdAlignParagraphCenter
wn_b[tdxq
.LeftIndent = 0
y2]-&]& .RightIndent = 0
jdE5~a+ .FirstLineIndent = 0
mWR4|1( .LineSpacing = 12
Hqnx
q .LineSpacingRule = wdLineSpaceExactly
9% l% .LineUnitAfter = 0
2aJS{[ .LineUnitBefore = 0
XNQAi (!GS .OutlineLevel = wdOutlineLevelBodyText
YEkh3FrbwH .PageBreakBefore = False
uZfnz
d)c .RightIndent = 0
7\*FEjRM] .WordWrap = True
{
-|{xBd .LineUnitAfter = 0.5
P =3RLL<l Y6,Rj:8 End With
k+I}PuG Case Else
1]IQg;q '不作处理
+xc'1id@[ End Select
\#o2\!@` "S3wk=?4 '含有inlineshape的段落处理
9j W2 If ShapeHeight > 30 Then
fwK}/0% .Paragraphs(paraCounter).LineSpacingRule = wdLineSpaceSingle '对有图片的段落设置为单倍行距
lEHzyh}2k End If
s Y?,0T_m [7_56\G4 If (ShapeWidth + ShapeHeight) > 150 Then
HV6f@ .Paragraphs(paraCounter).Style = "QLNU图片段落"
yV_4?nh End If
upj]6f"( S=_vv)6+4 '段落计数器递
D]c`B paraCounter = paraCounter + 1
&>e-(4Xu Me.lbCounter.Caption = "当前检测段落:" & paraCounter
z'uK3ng\hH Me.txtStatus.Text = ParaText
yQ#:J9HMJ DoEvents
U=h
lu Loop
l;
y7]DO End With
moP,B~ k}
]T;|h] msg = ""
8
k3S hx/N1x For i = 0 To Me.ErrMsg.ListCount - 1
n,B,"\fw msg = msg & vbCrLf & vbCrLf & Me.ErrMsg.List(i)
K\XH4kic Next
Dfq(Iv }y9mNT >``MR%E:< T3`ludm^u Me.txtStatus.Text = "格式化完成!" & vbCrLf & "开始时间:" & tm1 & vbCrLf & "结束时间:" & Now & vbCrLf & msg
T\w?$ s Me.cmdCheck.Enabled = True
"\0v,!@ Me.txtStatus.Visible = True
1x,[6H Me.lbParaType.Visible = False
v1a
6?- /mp*>sNr6 bContinue = False
c@v{`d End Sub
\(t@1]&jw oB74y Sub CheckPara(ByRef ChKRange As Range, ParaType As String, ReplaceTEXT As String, TitleString As String, TitleNo As String, shpCounter As Long, MaxShpHeight As Long, TotalShpWidth As Long)
%tG*C,l
] Dim pTEXT As String
CR6R?R3b 'v]u#/7a
pTEXT = ChKRange.Text
b~nAPY6 6mKjau{r_ ParaType = "其它"
Us+pc^A TitleString = pTEXT
dCj,b$ TitleNo = "N/A"
bdGIF'p% `--TP shpCounter = ChKRange.InlineShapes.Count
|9~GM If shpCounter <> 0 Then
@as"JAN MaxShpHeight = 0: TotalShpWidth = 0
j"AU z)x For i = 1 To shpCounter
>A@Y$. k = ChKRange.InlineShapes(i).Height
Q#nOJ(KV l = ChKRange.InlineShapes(i).Width
D#&q&6P{ If k > MaxShpHeight Then
#j *d^j& MaxShpHeight = k
sKlDu End If
gJ2>(k03y TotalShpWidth = TotalShpWidth + l
5/po2V9) Next
N^B o
.U0\ If MaxShpHeight > 60 Or TotalShpWidth > 150 Then
l}$ U])an# Exit Sub
]E] 2o End If
t3dlS`O End If
E;<l(.Ar 5jUYN-$GO '空行
$Y5)( If Len(pTEXT) <= 2 Then
<7-J0btV Exit Sub
$.9{if#o& End If
#v<QbA )T;?^kho z{Mr$%'EY '是否为表格中的文字
6252N]* If ActiveDocument.Paragraphs(paraCounter).Range.Information(wdWithInTable) Then
UI>Y0O ParaType = "表格内容"
i hh/sPi k = ActiveDocument.Paragraphs(paraCounter).Range.Information(wdEndOfRangeRowNumber)
6xD#? If k = 1 Then
&ZL3{M ParaType = "表格首行"
$H+VA@_ End If
w`q%#qRk Exit Sub
5uxBK"q End If
H,N)4;F<c =0;^(/1Mc '例外情况:脚注
r\AyN=
y If ActiveDocument.Paragraphs(paraCounter).Range.Information(wdInFootnote) Then
?_I[,N?@41 ParaType = "脚注"
gUeuUj Exit Sub
765p/** End If
SRDXfkoI 4.IU!.Uo '例外情况:尾注
r#xg#u oj If ActiveDocument.Paragraphs(paraCounter).Range.Information(wdInEndnote) Then
#>j.$2G> ParaType = "尾注"
5Hcf;P7 Exit Sub
6;|n]m\Vd End If
,=l7:n MNSbtT*^ If ActiveDocument.Paragraphs(paraCounter).Range.Information(wdInHeaderFooter) Then
;vt8R=T ParaType = "页眉页脚"
irN6g#B?
Exit Sub
%;.;>Y(- End If
Yv:55+ e!| 3E3HL7 bf9a1<\ With regEX
}#X8@ .Global = True
;]_o4e6\p e^ v.) .Pattern = "^第([1-9]|1|2|3|4|5|6|7|8|一|二|三|四|五|六|七|八|九|十)章(、|\.|\s|。|.)+(.{1,30})$"
A^p[52` If regEX.Test(pTEXT) Then
6ND`l5
ReplaceTEXT = regEX.Replace(pTEXT, "第$1章 $3")
ar:+;.n TitleString = regEX.Replace(pTEXT, "$3")
}d<}FJ-, TitleNo = regEX.Replace(pTEXT, "$1")
n> ^[T[.S ParaType = "章"
Q'%PNrN Exit Sub
Y5F]:gs@ End If
C`5 {'U
Rz[g .Pattern = "^(十一|十二|十三|十四|十五|十六|一|二|三|四|五|六|七|八|九|十)(、|\.|\s|。|.)+(.{1,40})$"
vap,y $C If regEX.Test(pTEXT) Then
w:
>5=mfk ParaType = "一级标题"
G#M
dfKH regEX.Execute (pTEXT)
+|tC'gCnV ReplaceTEXT = regEX.Replace(pTEXT, "$1、$3")
=b/L?dR.- TitleString = regEX.Replace(pTEXT, "$3")
@-+Q#
Zz` TitleNo = regEX.Replace(pTEXT, "$1")
=+AS/J
q Exit Sub
^a#X9 End If
92^w8Z. RIIitgV_ '全角或半角括号中的数字
B, 9w0 .Pattern = "(^\(|()(十一|十二|十三|十四|十五|十六|一|二|三|四|五|六|七|八|九|十)(\)|))(、|\.|\s|。|.)*(.{1,40})$"
Nj?/J47?, If regEX.Test(pTEXT) Then
h[PYP5{L ParaType = "二级标题"
WD1G&5XP regEX.Execute (pTEXT)
3Kn_mL3V- ReplaceTEXT = regEX.Replace(pTEXT, "($2)$5")
+zy=50, TitleString = regEX.Replace(pTEXT, "$5")
/PLn+- TitleNo = regEX.Replace(pTEXT, "$2")
PG,_^QGCX Exit Sub
gB<3-J1R End If
(&!NC[n, W^G>cC8.L '阿拉伯数字 1. 2.
rD*sl} .Pattern = "^([1-9]|1|2|3|4|5|6|7|8|9|0){1,2}(、|\.|\s|。|.)+(.{1,80})$"
.w]GWL If regEX.Test(pTEXT) Then
r3>i+i42 ParaType = "三级标题"
7U"[Gf regEX.Execute (pTEXT)
lGVEpCS} ReplaceTEXT = regEX.Replace(pTEXT, "$1. $3") '未进行全半角转换,如需要可分成两步分别检测
Sv &[f}S TitleString = regEX.Replace(pTEXT, "$3")
:sCqjz TitleNo = regEX.Replace(pTEXT, "$1")
F4K0)
; Exit Sub
3;a<_cE*@ End If
9
~ l
hsH $ aUo aI '全角或半角括号中的阿拉伯数字
zL\OB?)5J
.Pattern = "^(^\(|()([0-9]|0|1|2|3|4|5|6|7|8|9){1,2}(\)|))(、|\.|\s|。|.)*(.{1,80})$"
EOm:!D\ If regEX.Test(pTEXT) Then
X,LD ParaType = "四级标题"
hcyM6:} regEX.Execute (pTEXT)
8O Soel ReplaceTEXT = regEX.Replace(pTEXT, "($2) $5")
~V$|i" TitleString = regEX.Replace(pTEXT, "$5")
0Q^Ikiv TitleNo = regEX.Replace(pTEXT, "$2")
X$yN_7|+ Exit Sub
Uf, 4 End If
hXA6D) U4cY_p? '表格名称
$ibuWb"a .Pattern = "^表(\d{1,2}-{0,1}\d{0,1})([、|\.|。|.|\s]{1,9})(.{1,120})$"
sVl-N&/ If regEX.Test(pTEXT) Then
hEw-
O;T0 ParaType = "表格标题"
$]8h $ regEX.Execute (pTEXT)
A,`8#-AX ReplaceTEXT = Trim(regEX.Replace(pTEXT, "表$1. $3"))
Qci4J TitleString = Trim(regEX.Replace(pTEXT, "$3"))
f"St&q>[s TitleNo = Trim(regEX.Replace(pTEXT, "$1"))
|_yYLYH'
strSeperator = Trim(regEX.Replace(pTEXT, "$2")) '不知道为什么,但是发现传回的replacetext在修改Paragraph对象的Range.Text后,表格标题就会落入第一个单元格中,所以,只能用Paragraph.Range.Find.Execute方法替换
0=K9`=5d0 Exit Sub
4n4?4BEn End If
&9Xhl'' ]niJGt '图片名称
0@EwM .Pattern = "^图(\d{1,2}-{0,1}\d{0,1})(、|\.|\s|。|.)+(.{1,120})$"
ahPoEh If regEX.Test(pTEXT) Then
u?+Kkkk ParaType = "图片标题"
%DdJ ^qHI regEX.Execute (pTEXT)
c_V;DcZ ReplaceTEXT = regEX.Replace(pTEXT, "图$1. $3")
3mOtW%Hl TitleString = regEX.Replace(pTEXT, "$3")
eGX%KT"O TitleNo = regEX.Replace(pTEXT, "$1")
G>q(iF' Exit Sub
I}t#%/'YA End If
ezMI\r6 `(3/$% '参考文献
?yj6CL(, .Pattern = "^([\[|[])(\d+)([]|\]])([、|\.|\s|。|.]{0,1})" '[数字]、
,~"$k[M If regEX.Test(pTEXT) Then
P><o,s"v ParaType = "文献条目"
"U\4:k`: 'ReplaceTEXT = regEX.Replace(pTEXT, "$1$2$3$4")
PTEHP 'TitleNo = regEX.Replace(pTEXT, "[$2] ")
wR^ RM(1 Exit Sub
kS!viJwtT End If
!&"<oPjr+ KjQR$- prfx = Left(pTEXT, 2)
Qm/u h If prfx = "注:" Or prfx = "注:" Then
Ovj^IjG-` ParaType = "图表注解"
w08?DD]CDt Exit Sub
0fYj4`4=n End If
!=N"v
D*
V<j.xd7 CjiVnWSz< ParaType = "正文"
d20gf:@BM 65Cg]Dt71 End With
gmm|A9+tv End Sub
B`
k\ EL' mL4] l(U Sub ConvertListToOrdinary()
kS
DZZx Dim st As Paragraph
X_7UJ
jFw" With ActiveDocument
_N@ro For i = .Paragraphs.Count To 1 Step -1
=J ym%m Set st = .Paragraphs(i)
+Xemf? lst = st.Range.ListFormat.ListString
n+PzA[ If lst <> "" Then
0q'w8]m st.Range.ListFormat.RemoveNumbers
D
S'n st.Range.InsertBefore lst & " "
SGe^ogO"v End If
qB
CK40 Next
-UD\;D?$ End With
{\(L%\sV@ Set st = Nothing
rf$X>M=G End Sub
;vIrGZV< 3.qTLga|} Private Sub UserForm_Activate()
d`F&aC Me.lbTotal.Caption = "当前文章段落总数:" & ActiveDocument.Paragraphs.Count & " 共" & ActiveDocument.Sections.Count & "节"
[3!~PR] Me.lbTotal.Font.Bold = True
q5#J~n8Wr Me.txtStatus.Visible = False
4vwTs*eB` Me.cmdCheck.Enabled = True
kP?KXT3y tuhA
9}E End Sub
xQ@^$_ GxKqD;;u?= w.0qp)} Sub CheckSuperScript()
_~T!9 Selection.Find.ClearFormatting
'60 L~`K Selection.Find.Replacement.ClearFormatting
-
k"^o!p With Selection.Find
_-#'j2 .Text = "[【\[[〖](*)[】\]〗]]"
IhA* " .Replacement.Text = "[\1]"
#cCL.p"] .Replacement.Font.Superscript = True
;]pJj6J&v '.Replacement.Font.Color = wdColorBlue
Q_Gi]M9 .Forward = True
>2Kh0rIH .Wrap = wdFindContinue
ph-ATJ" .FORMAT = True
DuOG { .MatchCase = False
Et/&^&=\- .MatchWholeWord = False
%Jrt4sg[j- .MatchByte = False
D&/L: .MatchAllWordForms = False
smry2*g .MatchSoundsLike = False
di>cMS 4 c .MatchWildcards = True
o5Q{/ End With
uNHF'?X Selection.Find.Execute Replace:=wdReplaceAll
19j+lCSvH End Sub
8A+SjJ4$ :Cp'm'omb Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
T16{_ bContinue = False
?'<nx{!c Set regEX = Nothing
4Z/Q=Mq2
End Sub
jb^N|zb
`YIf_a{ Sub CeateOrModifyStyle()
\xS&v7b '
ruazOmnn~ '
48*Do}l]
Dim stl As Style
%y%j*B!% FG)$y[* Options.Pagination = False
o!!yd8~*r ANps1w#TP On Error Resume Next
iV eC=^1 For Each stl In ActiveDocument.Styles
n2fbp\ I stl.Delete
rhb@FE)Mc Next
9t#S= DP On Error GoTo 0
7K5P8N
, |
lkNi Set stl = Nothing
3fh8$A 7Ddaf>
DoEvents
HdPoO; On Error Resume Next
yn/rW$ N+y&,N, ActiveDocument.Styles.Add Name:="BaseStyle", Type:=wdStyleTypeParagraph
lj?v4$ ^)W[l!!<) ActiveDocument.Styles.Add Name:="QLNU论文题目", Type:=wdStyleTypeParagraph
E,f>1meN= ActiveDocument.Styles.Add Name:="QLNU中文摘要", Type:=wdStyleTypeParagraph
cwL1/DGDB G3
{=@Z1 ActiveDocument.Styles.Add Name:="QLNU英文标题", Type:=wdStyleTypeParagraph
/)>s##p* ActiveDocument.Styles.Add Name:="QLNU英文摘要", Type:=wdStyleTypeParagraph
?IGVErnJJC =%>oR ActiveDocument.Styles.Add Name:="QLNU目录项", Type:=wdStyleTypeParagraph
a@0BBihz ActiveDocument.Styles.Add Name:="QLNU章节标题", Type:=wdStyleTypeParagraph
3dRr/Ilc ActiveDocument.Styles.Add Name:="QLNU一级标题", Type:=wdStyleTypeParagraph
aM$W*-
Y ActiveDocument.Styles.Add Name:="QLNU二级标题", Type:=wdStyleTypeParagraph
gw}Mw ActiveDocument.Styles.Add Name:="QLNU三级标题", Type:=wdStyleTypeParagraph
4`8< ActiveDocument.Styles.Add Name:="QLNU四级标题", Type:=wdStyleTypeParagraph
Yl.0aS ActiveDocument.Styles.Add Name:="QLNU正文", Type:=wdStyleTypeParagraph
Z>^pCc\lH hc'-Dh ActiveDocument.Styles.Add Name:="QLNU表格标题", Type:=wdStyleTypeParagraph
/*c\qXA5 ActiveDocument.Styles.Add Name:="QLNU表格首行", Type:=wdStyleTypeParagraph
Ed
,D8ND ActiveDocument.Styles.Add Name:="QLNU表格内容", Type:=wdStyleTypeParagraph
1M}&Z H ActiveDocument.Styles.Add Name:="QLNU图片标题", Type:=wdStyleTypeParagraph
4X*>H ActiveDocument.Styles.Add Name:="QLNU图片段落", Type:=wdStyleTypeParagraph
D7S'*;F !1G ."fo ActiveDocument.Styles.Add Name:="QLNU参考文献", Type:=wdStyleTypeParagraph
(1NA On Error GoTo 0
BouTcC DoEvents
44F`$.v96 PfZ+PqS 'BaseStyle
b&5lY p"d ActiveDocument.Styles("BaseStyle").AutomaticallyUpdate = False
Ey4z.s'-l With ActiveDocument.Styles("BaseStyle").Font
mb!9&&2-t .NameFarEast = "宋体"
P'O#I}Dmw< .NameAscii = "Times New Roman"
r{rQu-|. .NameOther = "宋体"
= hN
!;7G .Size = 10.5
C|?o*fQ .Bold = wdUndefined
Qx'`PNU9\ .Italic = wdUndefined
,-OCc!7K .Subscript = wdUndefined
C(K; zo*S( .Subscript = wdUndefined
3hK#'."`N xQ'2BAEa .Underline = wdUnderlineNone
;JRs?1<=' .UnderlineColor = wdColorAutomatic
oI#a_/w .StrikeThrough = False
w-0mzk" .DoubleStrikeThrough = False
vVgg0Y2 |a#f\ .Outline = False
{pHM},WJ .Emboss = False
QurW/a .Shadow = False
-^ C=]Medl .Hidden = False
l}lIi8 .SmallCaps = False
Nq@+'<@p$ .AllCaps = False
<bD>m[8, .Color = wdColorAutomatic
'`Wwt
.A .Engrave = False
NZ3/5%We/ .Scaling = 100
L^{|uP15N .Kerning = 1
$e /^u[~: .Animation = wdAnimationNone
"&%#!2 .DisableCharacterSpaceGrid = False
gL3"Gg3 .EmphasisMark = wdEmphasisMarkNone
(S
v~2 End With
NMi45y(Y With ActiveDocument.Styles("BaseStyle").ParagraphFormat
A+UU~?3y .LeftIndent = 0
j8sH#b7Z .RightIndent = 0
,DZX$Ug~+E .SpaceBefore = 0
^'ryNa;" .SpaceBeforeAuto = False
uy}%0vLo .SpaceAfter = 0
59Gk3frk( .SpaceAfterAuto = False
Usta0Ag yOwA8^q .LineSpacingRule = wdLineSpaceSingle
b? j< BvQ .Alignment = wdAlignParagraphJustify
*tAg*$ ?Oc{bF7 .WidowControl = False
"5, .KeepWithNext = False
3dDX8M? .KeepTogether = False
_IdRF5<4 .PageBreakBefore = False
0]jA<vLR .NoLineNumber = False
~wVd$%7` o#hjvg .FirstLineIndent = CentimetersToPoints(0)
~jb"5CX .OutlineLevel = wdOutlineLevelBodyText
d%0~c'
D8a .CharacterUnitLeftIndent = 0
\2vg{ .CharacterUnitRightIndent = 0
nQ/E5y
.CharacterUnitFirstLineIndent = 0
FEJ~k1z .LineUnitBefore = 0
shMSN]S_x .LineUnitAfter = 0
nYJTKU .AutoAdjustRightIndent = True
!Lh^oPT"I .DisableLineHeightGrid = True
s|NjT
@ G4X .FarEastLineBreakControl = True
O/!bG~\Y .WordWrap = True
eBJUv]o % .Hyphenation = False
!S_^94 b@ hnznp1[#@ .HangingPunctuation = True
RTFZPq84 .HalfWidthPunctuationOnTopOfLine = True
ScSZGs 5& .AddSpaceBetweenFarEastAndAlpha = True
\{EpduwZ .AddSpaceBetweenFarEastAndDigit = True
.YZgOJi .BaseLineAlignment = wdBaselineAlignBaseline
"XT"|KF|D End With
0pSmj2/,. ActiveDocument.Styles("BaseStyle").NoSpaceBetweenParagraphsOfSameStyle = False
R+7oRXsu ActiveDocument.Styles("BaseStyle").ParagraphFormat.TabStops.ClearAll
=ID
2 ActiveDocument.Styles("BaseStyle").LanguageID = wdSimplifiedChinese
Z*Fr
B58 ActiveDocument.Styles("BaseStyle").NoProofing = False
1u|Rl:Q %b^OeWip '一级标题题样式
T
=2=k&| ActiveDocument.Styles("QLNU一级标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
1NcCy!+ ActiveDocument.Styles("QLNU一级标题").NextParagraphStyle = "BaseStyle"
p^
pOuy8 ActiveDocument.Styles("QLNU一级标题").AutomaticallyUpdate = False
U.@*`Fg With ActiveDocument.Styles("QLNU一级标题").Font
HyR!O> .NameFarEast = "黑体"
IO/4.m-aN# .NameAscii = "Arial Black"
=Z+nX0qF .NameOther = "黑体"
Wy%s1iu .Name = "黑体"
.n=Z:*JqQ .Size = 16 '三号
LB.c
o4 .Bold = True
/P
2[:[w .Italic = wdUndefined
}E7:ihy .Subscript = wdUndefined
;q1A*f\:# .Superscript = wdUndefined
yA3wtm/? End With
2r6'O6v With ActiveDocument.Styles("QLNU一级标题").ParagraphFormat
R9!Uo DU=dLE6-P; .LeftIndent = CentimetersToPoints(0)
hbcuK& .RightIndent = CentimetersToPoints(0)
_fwb!T}$ .FirstLineIndent = CentimetersToPoints(0)
zR32PG>9 36n>jS& .LineSpacingRule = wdLineSpaceSingle
<Tot|R; .Alignment = wdAlignParagraphCenter
_kY#D;`:r h)me\U7UC .WidowControl = True
,<Q~b%(3 .KeepWithNext = True
sQ8s7l0D .KeepTogether = True
A Z{^o4<q .OutlineLevel = wdOutlineLevelBodyText
-D^}S"' ys#i@ .LineUnitBefore = 0.5
UQ.7>Ug+8s .LineUnitAfter = 0.5
Y1arX^Zb End With
mP(kcMT" ActiveDocument.Styles("QLNU一级标题").NoSpaceBetweenParagraphsOfSameStyle = False
ZoB{x*IH ActiveDocument.Styles("QLNU一级标题").ParagraphFormat.TabStops.ClearAll
8L1oh
j ActiveDocument.Styles("QLNU一级标题").LanguageID = wdSimplifiedChinese
oY=q4D ActiveDocument.Styles("QLNU一级标题").NoProofing = True
NzW`B^p DoEvents
.WQ+AE8Q Z,.G%"i3C '二级
:(_+7N[KA ActiveDocument.Styles("QLNU二级标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
8+Td-\IMk ActiveDocument.Styles("QLNU二级标题").NextParagraphStyle = "BaseStyle"
aceZ3U>W ActiveDocument.Styles("QLNU二级标题").AutomaticallyUpdate = False
=GXu 5 8 With ActiveDocument.Styles("QLNU二级标题").Font
w\19[U3 .NameFarEast = "黑体"
+L=*:e\j .NameAscii = "Arial Narrow"
Y+3!f#exm .NameOther = "黑体"
0W%@gs5d& .Name = "黑体"
>~\89E02 .Size = 15 '小三号
8#D:H/`' .Bold = False
A?*o0I .Outline = False
$.:mai .Italic = wdUndefined
ZY56\qcY .Subscript = wdUndefined
$v b
,P( .Superscript = wdUndefined
X.TI>90{ End With
Zx$ol;Yd With ActiveDocument.Styles("QLNU二级标题").ParagraphFormat
=-o'gL .LeftIndent = CentimetersToPoints(0)
-`Y:~q1 .RightIndent = CentimetersToPoints(0)
EbZdas!l .FirstLineIndent = CentimetersToPoints(0)
~RD+.A wI5Yn
h .LineSpacingRule = wdLineSpaceSingle
3or\: .Alignment = wdAlignParagraphLeft
uZi.H
G{<) H- p;6C< .WidowControl = True
Tb1U^E: .KeepWithNext = True
:ah
5`nmPO .KeepTogether = True
3!
~K^Z] .PageBreakBefore = False
JO'>oFv_W .OutlineLevel = wdOutlineLevelBodyText
')N{wSM9Ft [+Y{%U .LineUnitBefore = 0.5
]LZ`LL'#Y_ .LineUnitAfter = 0.5
O0PJ6:9P ?J,AB #+ End With
+B|7p9qy ActiveDocument.Styles("QLNU二级标题").NoSpaceBetweenParagraphsOfSameStyle = False
Pe2w sR"_U ActiveDocument.Styles("QLNU二级标题").ParagraphFormat.TabStops.ClearAll
9*:gr#(5 ActiveDocument.Styles("QLNU二级标题").LanguageID = wdSimplifiedChinese
wIf
{6z{ ActiveDocument.Styles("QLNU二级标题").NoProofing = True
178Mb\8 DoEvents
T,_(?YJW /(8a~f&%r '三级标题样式
TH &qX ActiveDocument.Styles("QLNU三级标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
++Ww88820 ActiveDocument.Styles("QLNU三级标题").NextParagraphStyle = "BaseStyle"
'>(.%@ ActiveDocument.Styles("QLNU三级标题").AutomaticallyUpdate = False
j8K,jZ With ActiveDocument.Styles("QLNU三级标题").Font
6yy;JQAke .NameFarEast = "宋体"
LZ~"VV^ .NameAscii = "Times New Roman"
$M:3 XAN .NameOther = "黑体"
Em7 WDu0 .Name = "黑体"
J# kl
7 .Size = 14 '四号
vJ`.iRU| .Bold = False
; <Km3 .Outline = False
x|KWyfOS .Italic = wdUndefined
Ac|5. ?|N .Subscript = wdUndefined
gip/(
/NX .Superscript = wdUndefined
|~<N -~.C End With
T%R:NQf With ActiveDocument.Styles("QLNU三级标题").ParagraphFormat
yE} dj)wd .LeftIndent = CentimetersToPoints(0)
*XWq?hi .RightIndent = CentimetersToPoints(0)
aTzDew .FirstLineIndent = CentimetersToPoints(0)
_P?\.W@ A%\tiZe .LineSpacingRule = wdLineSpaceSingle
J`*iZvW#Bx .Alignment = wdAlignParagraphLeft
Q# ?wXX47 M=]5WZO~A .WidowControl = True
X_$a,"'~) .KeepWithNext = True
;
"3+YTtp .KeepTogether = True
S.|FL%; .PageBreakBefore = False
drq hQ .OutlineLevel = wdOutlineLevelBodyText
d^|0R \/|)HElKR .CharacterUnitLeftIndent = 0
Yct5V,X^ .CharacterUnitRightIndent = 0
H UWxPIu .CharacterUnitFirstLineIndent = 2
De_ CF8 V#q}Wysft .LineUnitBefore = 0.5
:"o
o> .LineUnitAfter = 0
4@;-%H&7 End With
@$eT~ C ActiveDocument.Styles("QLNU三级标题").NoSpaceBetweenParagraphsOfSameStyle = False
_KD5T4FZR ActiveDocument.Styles("QLNU三级标题").ParagraphFormat.TabStops.ClearAll
4l8BQz}sb ActiveDocument.Styles("QLNU三级标题").LanguageID = wdSimplifiedChinese
c6Q(Ygc
ActiveDocument.Styles("QLNU三级标题").NoProofing = True
smQVWs> DoEvents
gX5&d\y JmpsQ,, '四级标题样式
{I{:GcS ActiveDocument.Styles("QLNU四级标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
n+1y ActiveDocument.Styles("QLNU四级标题").NextParagraphStyle = "BaseStyle"
9tg)Mo% ActiveDocument.Styles("QLNU四级标题").AutomaticallyUpdate = False
{0YAzZ7 With ActiveDocument.Styles("QLNU四级标题").Font
D,ly#Nn .NameFarEast = "宋体"
W
>(vYU .NameAscii = "Times New Roman"
b @;.F!x .NameOther = "宋体"
uENdI2EY8y .Name = "宋体"
<f~Fl^^8 .Size = 12 '小四号
]=F8p2w? .Bold = True
VK3it3FI>3 .Outline = False
a1N!mQ^ .Italic = wdUndefined
u2(eaP8d .Subscript = wdUndefined
c3
&m9zC .Superscript = wdUndefined
`3q;~ 9 End With
?nKF6f With ActiveDocument.Styles("QLNU四级标题").ParagraphFormat
T{vR, 0F;
,
O3Q .LeftIndent = CentimetersToPoints(0)
<EO<x D=: .RightIndent = CentimetersToPoints(0)
FnHi(S|A .FirstLineIndent = CentimetersToPoints(0)
cyd~2\Kv~ GQ_Ia\ .LineSpacingRule = wdLineSpaceSingle
%G3sjnI;l .Alignment = wdAlignParagraphLeft
+7}iu/B!9 o{-<L .WidowControl = True
@o e\"vz .KeepWithNext = True
hF&}lPVtv .KeepTogether = True
f*xpE`& .PageBreakBefore = False
1MA@JA:T .OutlineLevel = wdOutlineLevelBodyText
y~<@x. f0Hq8qAF;^ .CharacterUnitLeftIndent = 0
H]#Rg`~n .CharacterUnitRightIndent = 0
1QJBb \ .CharacterUnitFirstLineIndent = 2
{fSfq&o .>6 Wv0 .LineUnitBefore = 0
mW`oq .LineUnitAfter = 0
p D=w>
" @\Js8[wS9@ End With
T,JA#Rk|1N ActiveDocument.Styles("QLNU四级标题").NoSpaceBetweenParagraphsOfSameStyle = False
>adV(V< ActiveDocument.Styles("QLNU四级标题").ParagraphFormat.TabStops.ClearAll
+1;'B4 ActiveDocument.Styles("QLNU四级标题").LanguageID = wdSimplifiedChinese
?H R%bngK ActiveDocument.Styles("QLNU四级标题").NoProofing = True
_ :^7a3I DoEvents
,R wfp=*E 84&XW '正文校式
w>~M}Ahj ActiveDocument.Styles("QLNU正文").BaseStyle = ActiveDocument.Styles("BaseStyle")
,7d|O}B ActiveDocument.Styles("QLNU正文").NextParagraphStyle = "BaseStyle"
uL?vG6% ^1 ActiveDocument.Styles("QLNU正文").AutomaticallyUpdate = False
EA{U!b]cU With ActiveDocument.Styles("QLNU正文").Font
YTyX`Y# +iF
1sC_ .NameFarEast = "宋体"
t"s5\;IJ .NameAscii = "Times New Roman"
v
i {uy .NameOther = "宋体"
]y1fM0 .Name = "宋体"
8}BB OD _`a&9i
& .Size = 12 '小四号
Q* O<@ '=cKU0
G # .Bold = wdUndefined
CHaE;olo .Italic = wdUndefined
O
%1/r* .Subscript = wdUndefined
*i<\iM
oW .Superscript = wdUndefined
yqSY9EX7 {)K](S
~ .Outline = False
I+,SZ]n .Emboss = False
p/]s)uYp$ .Shadow = False
=7ydk"xM* .Hidden = False
Jfg7\&| d$;/T(' .DisableCharacterSpaceGrid = True
hRTMFgO End With
]7qiUdxt: With ActiveDocument.Styles("QLNU正文").ParagraphFormat
@%W]".*'} _|,{ ^m|d
.LeftIndent = CentimetersToPoints(0)
d34Y'r .RightIndent = CentimetersToPoints(0)
@C.GKeM* .FirstLineIndent = CentimetersToPoints(0)
F;D1F+S qSiWnN8D
t .LineSpacingRule = wdLineSpaceExactly
C9KWa*3 .LineSpacing = 20
,-rB=|w .Alignment = wdAlignParagraphLeft
-fIc4u[ &/ouW'oP .WidowControl = False
[6gO .KeepWithNext = False
NW.XA! =E) .KeepTogether = False
0\a8}b|| .PageBreakBefore = False
E20 :uZ7\ .Hyphenation = False
O]nT>;PXX {0's~U+@ .OutlineLevel = wdOutlineLevelBodyText
U=!@Db5k~ Q;26V4 N\R=cwk .CharacterUnitLeftIndent = 0
C}CKnkMMD .CharacterUnitRightIndent = 0
F,v7ifo#f .CharacterUnitFirstLineIndent = 2
kR6A3?[ m4/}Jx[ .LineUnitBefore = 0
ESDB[
O+`x .LineUnitAfter = 0
.2X2b<%) .SpaceBefore = 0
v$$]Gv( .SpaceAfter = 0
VO`"< H+cNX\, .DisableLineHeightGrid = True
; Zq/eiB End With
8sw,k ActiveDocument.Styles("QLNU正文").NoSpaceBetweenParagraphsOfSameStyle = False
g#W_S? ActiveDocument.Styles("QLNU正文").ParagraphFormat.TabStops.ClearAll
5()Fvae{k ActiveDocument.Styles("QLNU正文").LanguageID = wdSimplifiedChinese
l
C\E ActiveDocument.Styles("QLNU正文").NoProofing = True
7U:=~7GH DoEvents
y(8d?]4:_ W(&6 '图片段落样式
Z
g $Tf ActiveDocument.Styles("QLNU图片段落").BaseStyle = ActiveDocument.Styles("BaseStyle")
?q%b*Ek ActiveDocument.Styles("QLNU图片段落").NextParagraphStyle = "BaseStyle"
3ps,uozj ActiveDocument.Styles("QLNU图片段落").AutomaticallyUpdate = False
l_+A5Xy With ActiveDocument.Styles("QLNU图片段落").Font
HZ\k-!2 .Size = 12 '小四号
D@vMAW .Italic = wdUndefined
:)P<jX-G .Subscript = wdUndefined
&(O06QL .Superscript = wdUndefined
|< N frz End With
,k*F`.[ With ActiveDocument.Styles("QLNU图片段落").ParagraphFormat
v*P[W_. elbG\qXBp .LeftIndent = CentimetersToPoints(0)
x N`T .RightIndent = CentimetersToPoints(0)
v["3 .FirstLineIndent = CentimetersToPoints(0)
.C5@QKU u@D.i4U .LineSpacingRule = wdLineSpaceSingle
|NEd@ .Alignment = wdAlignParagraphCenter
%ejeyc .KeepWithNext = True
F";FG 0 .OutlineLevel = wdOutlineLevelBodyText
H~m]nV,r ="B
n=> .CharacterUnitLeftIndent = 0
#pu}y,QN$ .CharacterUnitRightIndent = 0
g@E&uyM .CharacterUnitFirstLineIndent = 0
*]{=8zc2 oBw}hH,hp .LineUnitBefore = 0
k|#Zy, .LineUnitAfter = 0
r'd/qnd End With
?~)Ak`= ActiveDocument.Styles("QLNU图片段落").NoSpaceBetweenParagraphsOfSameStyle = False
-2lRia ActiveDocument.Styles("QLNU图片段落").ParagraphFormat.TabStops.ClearAll
~n]NyVFP ActiveDocument.Styles("QLNU图片段落").LanguageID = wdSimplifiedChinese
B| Q6! ActiveDocument.Styles("QLNU图片段落").NoProofing = True
3A
R%&:- DoEvents
%CT!$Y'n K/Jk[29"\ ]p$zvMf} '第X章
&|=
?acv ActiveDocument.Styles("QLNU章节标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
MFTC6L+T ActiveDocument.Styles("QLNU章节标题").NextParagraphStyle = "BaseStyle"
~hD{coVTI ActiveDocument.Styles("QLNU章节标题").AutomaticallyUpdate = False
C
k
tX0 With ActiveDocument.Styles("QLNU章节标题").Font
j)6G7T|
.NameFarEast = "黑体"
&s-VSu7 .NameAscii = "Arial Black"
eU~?p|Np .NameOther = "Arial Black"
ylkqhs& .Name = "黑体"
t F/nah .Size = 16
^/{4'\p .Bold = True
T~:_}J .UnderlineColor = wdColorAutomatic
X,Zd= .Outline = False
2v\W1VF .Italic = wdUndefined
cQ,9Rnfl, .Subscript = wdUndefined
g8Aj `O .Superscript = wdUndefined
U_*3>Q
.Scaling = 100
@ta?&Qf) .DisableCharacterSpaceGrid = True
0pNo`Bm End With
`Qq/F] With ActiveDocument.Styles("QLNU章节标题").ParagraphFormat
c
*1S}us .LineSpacingRule = wdLineSpaceSingle
!Mil?^ .Alignment = wdAlignParagraphCenter
qC.i6IL .WidowControl = True
Dqr9Vv .KeepWithNext = True
S.]MOB dt .KeepTogether = True
kJeu40o
N .PageBreakBefore = True
B"[{]GP BY .OutlineLevel = wdOutlineLevelBodyText
;KS`,<^- h,hL?imD .LeftIndent = CentimetersToPoints(0)
<_f`$z .RightIndent = CentimetersToPoints(0)
2[BA(B .FirstLineIndent = CentimetersToPoints(0)
,cS0 (txt8q .CharacterUnitLeftIndent = 0
,TJ/3_ lH .CharacterUnitRightIndent = 0
@Mr}6x* .CharacterUnitFirstLineIndent = 0
=phiD&= lEa W7
j .LineUnitBefore = 1
m >hovikY* .LineUnitAfter = 0.5
%1Jd^[W DvJB59:_} .AutoAdjustRightIndent = False
k.{G&]r{ .DisableLineHeightGrid = True
TF)8qHy! u .FarEastLineBreakControl = True
J=P;W2L .WordWrap = True
gA:[3J,[; End With
s*+ZYPk ActiveDocument.Styles("QLNU章节标题").NoSpaceBetweenParagraphsOfSameStyle = False
Yhk6Uog{
4 ActiveDocument.Styles("QLNU章节标题").ParagraphFormat.TabStops.ClearAll
Z^+a*^w~{ ActiveDocument.Styles("QLNU章节标题").LanguageID = wdSimplifiedChinese
Mz}i
[|U\ ActiveDocument.Styles("QLNU章节标题").NoProofing = True
r./z,4A` DoEvents
1t%<5O;R
b_mWu@$ '表格标题
'
^B3pR: ActiveDocument.Styles("QLNU表格标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
7*g(@d ActiveDocument.Styles("QLNU表格标题").NextParagraphStyle = "BaseStyle"
:}y| 4*z ActiveDocument.Styles("QLNU表格标题").AutomaticallyUpdate = False
zP|*(* With ActiveDocument.Styles("QLNU表格标题").Font
2MT_#r_ .NameFarEast = "楷体"
O,]_ tp .NameAscii = "Arial"
Zx9.p Fc" .Name = "楷体"
i^/DiWdyf .Size = 10.5
kc|>Q7~{ .Bold = True
)(.%QSA\C .Underline = wdUnderlineNone
r?afv.@L2 .Italic = wdUndefined
E -
KK .Subscript = wdUndefined
(NM6micc .Superscript = wdUndefined
fOJj(0=y .Color = wdColorAutomatic
R
^^1/% End With
L"9 Gc With ActiveDocument.Styles("QLNU表格标题").ParagraphFormat
XqX
I(q^ 4[x
A-
\ .LineSpacingRule = wdLineSpaceSingle
+/
}_%Cf8 .Alignment = wdAlignParagraphCenter
}8
\|1@09 .KeepWithNext = True
cb4b,Ri .KeepTogether = True
H-m`Dh5{ .OutlineLevel = wdOutlineLevelBodyText
@LHtt/& =<>pKQ)[ .LeftIndent = CentimetersToPoints(0)
aa!a&L|! .RightIndent = CentimetersToPoints(0)
mf~Lzp .FirstLineIndent = CentimetersToPoints(0)
x57'Cg \ @[0jFjK .CharacterUnitLeftIndent = 0
B%y! aQep .CharacterUnitRightIndent = 0
Y 0]Kl^\A .CharacterUnitFirstLineIndent = 0
oc =tI@W 8k%H[Smn: .LineUnitBefore = 1
-g<cinNSp .LineUnitAfter = 0
`:R-[>5P8 X-v~o/r7 End With
Lv^a+' ActiveDocument.Styles("QLNU表格标题").NoSpaceBetweenParagraphsOfSameStyle = False
|zb`&tv} ActiveDocument.Styles("QLNU表格标题").ParagraphFormat.TabStops.ClearAll
5{HtJ?sKc5 ActiveDocument.Styles("QLNU表格标题").LanguageID = wdSimplifiedChinese
fX""xTNPi ActiveDocument.Styles("QLNU表格标题").NoProofing = True
-P*
xyI DoEvents
{ $X
X o6:45 '表格首行
0tSA|->( ActiveDocument.Styles("QLNU表格首行").BaseStyle = ActiveDocument.Styles("BaseStyle")
1=ip,D ActiveDocument.Styles("QLNU表格首行").AutomaticallyUpdate = False
sD.6"w7} With ActiveDocument.Styles("QLNU表格首行").Font
$Llvp bl .NameFarEast = "楷体"
SUo^c1)G .NameAscii = "Times New Roman"
rEg+i@~ .Name = "楷体"
<gR`)YF7 .Size = 9
8 `o{b"l+ .Bold = True
Gk{W:866 .Underline = wdUnderlineNone
$u&|[vcP0 .Italic = wdUndefined
|O%:P}6c .Subscript = wdUndefined
o;*]1 .Superscript = wdUndefined
Io09W ^ End With
98jD"*W5 With ActiveDocument.Styles("QLNU表格首行").ParagraphFormat
E+:.IuXW$ .LineSpacingRule = wdLineSpaceSingle
XEa~)i{O .Alignment = wdAlignParagraphCenter
X+d&OcO=q `|uoqKv .LeftIndent = CentimetersToPoints(0)
/XjN%| .RightIndent = CentimetersToPoints(0)
7<fL[2- .FirstLineIndent = CentimetersToPoints(0)
mQFa/7FX $e>/?Ss Cv0&prt .CharacterUnitLeftIndent = -0.5
5a8JVDLX^ .CharacterUnitRightIndent = -0.5
Th_Q
owk .CharacterUnitFirstLineIndent = -0.5
KQ- ,W8Q5 )K8P+zn~ .LineUnitBefore = 0
P_v0))n{ .LineUnitAfter = 0
<( cM*kV .SpaceBefore = 0
n#)PvV~ .SpaceAfter = 0
l&vm[3 K*0aXr? End With
jGJ.Pvc>i ActiveDocument.Styles("QLNU表格首行").NoSpaceBetweenParagraphsOfSameStyle = False
lGl[^
0 ActiveDocument.Styles("QLNU表格首行").ParagraphFormat.TabStops.ClearAll
S_ZLTcq<1 ActiveDocument.Styles("QLNU表格首行").LanguageID = wdSimplifiedChinese
9/FG,9 ActiveDocument.Styles("QLNU表格首行").NoProofing = True
}7-7
t{G DoEvents
7&=-a|k~ s bs[=
LW4 '表格内容
,I/2.Q})[ ActiveDocument.Styles("QLNU表格内容").BaseStyle = ActiveDocument.Styles("BaseStyle")
v/]Qq ActiveDocument.Styles("QLNU表格内容").AutomaticallyUpdate = False
&zO3qt6 With ActiveDocument.Styles("QLNU表格内容").Font
+SO2M|ru& .NameFarEast = "楷体"
]Jja .NameAscii = "Times New Roman"
};i&a%I| .Name = "楷体"
2%`^(\y .Size = 9
P"oYC$ .Bold = False
sg+ZQDF{x .Underline = wdUnderlineNone
\nrgAC-b .Italic = wdUndefined
@Q/x&BV .Subscript = wdUndefined
"[#@;{@Gt .Superscript = wdUndefined
Cc@=? End With
Gv!BB=ir( With ActiveDocument.Styles("QLNU表格内容").ParagraphFormat
0Z@ARMCe|m .LineSpacingRule = wdLineSpaceSingle
Czq1
kz .Alignment = wdAlignParagraphCenter
vYYS.ve dK[* .LeftIndent = CentimetersToPoints(0)
?s1u#'aO .RightIndent = CentimetersToPoints(0)
71JM
[2 .FirstLineIndent = CentimetersToPoints(0)
E]e,cd iTj"lA .CharacterUnitLeftIndent = -0.5
UY1JB^J$ .CharacterUnitRightIndent = -0.5
c*Eok?O .CharacterUnitFirstLineIndent = -0.5
fEx+gQW_ .LineUnitBefore = 0
hN Z4v/ .LineUnitAfter = 0
14mXx}O .SpaceBefore = 0
/#:Rd^ .SpaceAfter = 0
5{
8x*PSl End With
av'd%LZP ActiveDocument.Styles("QLNU表格首行").NoSpaceBetweenParagraphsOfSameStyle = False
dDsjPM;2 ActiveDocument.Styles("QLNU表格首行").ParagraphFormat.TabStops.ClearAll
<WZ1- ActiveDocument.Styles("QLNU表格首行").LanguageID = wdSimplifiedChinese
3Ne9%" ActiveDocument.Styles("QLNU表格首行").NoProofing = True
V"w`! DoEvents
|De!ti {E;2&d '图片标题
w> Tyk#7lw ActiveDocument.Styles("QLNU图片标题").BaseStyle = ActiveDocument.Styles("BaseStyle")
IOSuaLH^ ActiveDocument.Styles("QLNU图片标题").NextParagraphStyle = "BaseStyle"
e} sc]MTM ActiveDocument.Styles("QLNU图片标题").AutomaticallyUpdate = False
ox!|)^`$_ With ActiveDocument.Styles("QLNU图片标题").Font
JRHf.? .NameFarEast = "楷体"
<$RS*n .NameAscii = "Times New Roman"
L2[Ei|9_ .Name = "楷体"
6U;Jg_zS .Size = 10.5
C/{nr-V3u .Bold = True
6 {b%Jfo .Underline = wdUnderlineNone
Wv6z%r< .Italic = wdUndefined
,k4z; .Subscript = wdUndefined
t-.2+6"\ .Superscript = wdUndefined
dE 3i= .Outline = False
*37LN .Shadow = False
YRg=yVo2 .Color = wdColorAutomatic
qk_p}
l-F1 End With
_#/!s]$d#
With ActiveDocument.Styles("QLNU图片标题").ParagraphFormat
[
c ~LY4: .LineSpacingRule = wdLineSpaceSingle
zAKq7'_= .Alignment = wdAlignParagraphCenter
>k$[hk*~ nQ:ml .KeepWithNext = wdUndefined
XR{5]lKt_ .KeepTogether = True
dNR7e .OutlineLevel = wdOutlineLevelBodyText
X{0ax. }}kS~
w-# .LeftIndent = CentimetersToPoints(0)
w/lXZg .RightIndent = CentimetersToPoints(0)
Paae-EmC .FirstLineIndent = CentimetersToPoints(0)
R=][>\7]} ;FV~q{ .CharacterUnitLeftIndent = 0
m1^dT_7Z
.CharacterUnitRightIndent = 0
*%ed;>6:Q .CharacterUnitFirstLineIndent = 0
GVjv**U XV74Fl .LineUnitBefore = 0
&