text 芝加哥代码2018年4月4日更新
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 芝加哥代码2018年4月4日更新相关的知识,希望对你有一定的参考价值。
Sub DeletePage(ByVal control As IRibbonControl)
Call layout_search_replace.jump_to_reference_section
With selection.Find
.Text = " ([0-9]{3})[–-]([0-9])([0-9])([0-9])" '三位数
.MatchWildcards = True
.ClearFormatting
.Forward = True
.Replacement.Text = ""
.Wrap = wdFindStop
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Range.Characters(2) = selection.Range.Characters(6) Then
selection.Range.HighlightColorIndex = wdBrightGreen
.Replacement.Text = " \1–\3\4"
.Execute Replace:=wdReplaceOne
If selection.Range.Characters(6).Text = "0" Then
selection.Range.Characters(6).Delete
End If
End If
Loop
End With
Call layout_search_replace.jump_to_reference_section
With selection.Find
.Text = " ([0-9]{4})[–-]([0-9])([0-9])([0-9]{2})" '四位数
.MatchWildcards = True
.ClearFormatting
.Forward = True
.Replacement.Text = ""
.Wrap = wdFindStop
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Range.Characters(2) = selection.Range.Characters(7) Then
selection.Range.HighlightColorIndex = wdBrightGreen
If selection.Range.Characters(3) = selection.Range.Characters(8) Then
.Replacement.Text = " \1–\4"
.Execute Replace:=wdReplaceOne
If selection.Range.Characters(7).Text = "0" Then
selection.Range.Characters(7).Delete
End If
Else
.Replacement.Text = " \1–\3\4"
.Execute Replace:=wdReplaceOne
End If
End If
selection.collapse wdCollapseEnd
Loop
End With
Call layout_search_replace.jump_to_reference_section
With selection.Find
.Text = " ([0-9]{5})[–-]([0-9])([0-9])([0-9])([0-9]{2})" '五位数
.MatchWildcards = True
.ClearFormatting
.Forward = True
.Replacement.Text = ""
.Wrap = wdFindStop
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Range.Characters(2) = selection.Range.Characters(8) Then
selection.Range.HighlightColorIndex = wdBrightGreen
If selection.Range.Characters(3) = selection.Range.Characters(9) Then
If selection.Range.Characters(4) = selection.Range.Characters(10) Then
.Replacement.Text = " \1–\5"
.Execute Replace:=wdReplaceOne
If selection.Range.Characters(8) = 0 Then
selection.Range.Characters(8).Delete
End If
Else
.Replacement.Text = "\1–\4\5"
.Execute Replace:=wdReplaceOne
End If
Else
.Replacement.Text = "\1–\3\4\5"
.Execute Replace:=wdReplaceOne
End If
End If
Loop
End With
End Sub
Sub ExchangeName(ByVal control As IRibbonControl)
Dim myrange As Range
Call layout_search_replace.jump_to_reference_section
With selection.Find
.Text = "[A-Z][A-Za-z]{1,}\, [A-Z]\."
.MatchWildcards = True
.Wrap = wdFindStop
.Forward = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Range.Previous(wdCharacter, 2) <> ")" And Asc(selection.Range.Previous(wdCharacter, 1)) <> 13 Then
' If IsNumeric(selection.Range.Next(wdCharacter, 5)) = False Then
' selection.MoveEndUntil "."
' 'selection.MoveEndWhile ".,"
' End If
If selection.Range.Next = "," Then
selection.MoveRight wdCharacter, 1, wdExtend
End If
selection.MoveRight wdCharacter, 1, wdExtend
Set myrange = selection.Range
myrange.Select
myrange.SetRange Start:=selection.Range.Start + 1 + InStr(selection.Range, ","), End:=selection.Range.End
myrange.HighlightColorIndex = wdYellow
myrange.Cut
selection.collapse wdCollapseStart
selection.Paste
'selection.Comments.Add Range:=ActiveDocument.Range(Start:=selection.Range.Start - 3, End:=selection.Range.Start), Text:="The authors name please use full name."
'selection.TypeText ", "
If selection.Range.Next = "," Then
selection.MoveRight wdCharacter, 1, wdExtend
Set myrange = selection.Range
myrange.Select
myrange.SetRange Start:=selection.Range.Start + 1 + InStr(selection.Range, ","), End:=selection.Range.End
myrange.HighlightColorIndex = wdYellow
myrange.Cut
selection.collapse wdCollapseStart
selection.Paste
' selection.Comments.Add Range:=ActiveDocument.Range(Start:=selection.Range.Start - 3, End:=selection.Range.Start), Text:="The authors name please use full name."
selection.TypeText " "
End If
End If
Loop
End With
End Sub
Sub RefCite(ByVal control As IRibbonControl)
Dim MainR As Range
Dim mainrange As Range
Dim MainCount As Integer
Call word2html.change_web_layout
Call word2html.save_filtered_html
Dim DocPath As String
DocPath = ActiveDocument.Path
ActiveDocument.Close
Dim fso As Object, sFile As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set sFile = fso.OpenTextFile("C:\Users\MDPI\AppData\Roaming\Microsoft\Templates\Auxiliary_line.docx")
Dim doc
Set doc = Documents.Open(FileName:=DocPath & "\forMerrin.htm", Visible:=True)
sFile.Close
Set fso = Nothing
Set sFile = Nothing
With doc
Call kr_deck.aselect_whole_reference '文献给style
selection.Style = ActiveDocument.Styles("_4_text_citation")
Dim arr
Dim monthKr
Dim i As Long
arr = "January,February,March,April,May,June,July,August,September,October,November,December"
monthKr = Split(arr, ",")
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\([!0-9\(\)][!\(\)]@[0-9]{4}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And InStr(selection.Range, "=") = 0 Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr:
End If
Next i
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
End If
kr:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = "\([!0-9\(\)][!\(\)]@[0-9]{4}[!\)]{1,}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And InStr(selection.Range, "=") = 0 Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr1:
End If
Next i
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
End If
kr1:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,}??[a-z]{1,} [0-9]{4}" '一个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr2:
Exit For
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr2:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,} [0-9]{4}" ' 一个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr3:
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr3:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,}??[a-z]{1,} and [A-Z][!0-9]{1,} [0-9]{4}" ' 两个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr4:
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr4:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,}??[a-z]{1,} and [A-Z][a-z]{1,}??[a-z]{1,} [0-9]{4}" ' 两个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr5:
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr5:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,} and [A-Z][a-z]{1,}??[a-z]{1,} [0-9]{4}" ' 两个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr6:
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr6:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,} and [A-Z][a-z]{1,} [0-9]{4}" ' 两个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr7:
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr7:
Loop
End With
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " [A-Z][a-z]{1,} et al. [0-9]{4}" ' 三个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr8:
End If
Next i
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr8:
Loop
End With
'
Dim AuthorR As Range
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " by [!0-9\(\)\,]{1,} \([0-9]{4}\)" '一个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindStop
.Format = True
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
selection.Range.Select
Set AuthorR = selection.Range
AuthorR.Select
AuthorR.SetRange selection.Range.Start + 4, selection.Range.End
AuthorR.Select
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr9:
End If
Next i
AuthorR.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr9:
Loop
End With '
'
Dim AuthorR1 As Range
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " of [!0-9\(\)\,]{1,} \([0-9]{4}\)" '一个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindStop
.Format = True
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr10:
End If
Next i
selection.Range.Select
Set AuthorR1 = selection.Range
AuthorR1.Select
AuthorR1.SetRange selection.Range.Start + 4, selection.Range.End
AuthorR1.Select
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
AuthorR1.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr10:
Loop
End With '
Dim AuthorR2 As Range
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.Text = " the [!0-9\(\)\,]{1,} \([0-9]{4}\)" '一个作者
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindStop
.Format = True
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
For i = LBound(monthKr) To UBound(monthKr)
If InStr(selection.Range, monthKr(i)) > 0 Then
GoTo kr11:
End If
Next i
selection.Range.Select
Set AuthorR2 = selection.Range
AuthorR2.Select
AuthorR2.SetRange selection.Range.Start + 5, selection.Range.End
AuthorR2.Select
If InputBox("Is this a reference call-out?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
AuthorR2.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
End If
kr11:
Loop
End With '
selection.HomeKey wdStory
selection.Find.ClearFormatting
selection.Find.Replacement.ClearFormatting
selection.Find.Replacement.Font.Color = wdColorRed
With selection.Find
.Text = "\([1-9][0-9][0-9][0-9]" '红色高亮四位数
.Replacement.Text = ""
.Forward = True
.Highlight = False
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found And selection.Style <> ActiveDocument.Styles("_4_text_citation") Then
selection.Style = ActiveDocument.Styles("_4_text_citation")
selection.collapse wdCollapseEnd
Else
selection.collapse wdCollapseEnd
End If
Loop
End With
Call word2html.forthcoming_highlight
Call word2html.n_d_highlight
selection.HomeKey wdStory
'.Close True
End With
End Sub
Sub comments(ByVal control As IRibbonControl)
Select Case control.ID
Case "Chicago_deck_comment"
selection.Range.HighlightColorIndex = wdYellow
selection.comments.Add Range:=selection.Range, Text:=""
ActiveWindow.View.ShowRevisionsAndComments = True
Case "Chicago_comments_1"
selection.Range.HighlightColorIndex = wdYellow
selection.comments.Add Range:=selection.Range, Text:="Is it reference citation? if so, please add reference information in reference list. "
ActiveWindow.View.ShowRevisionsAndComments = True
Case "Chicago_comments_2"
selection.Range.HighlightColorIndex = wdYellow
selection.comments.Add Range:=selection.Range, Text:="This reference has not been cited in the main text, please add citation in the main text, or delete this reference. "
ActiveWindow.View.ShowRevisionsAndComments = True
Case "Chicago_comments_3"
selection.Range.HighlightColorIndex = wdYellow
selection.comments.Add Range:=selection.Range, Text:="The citation year is different from the one in reference list, please confirm which is correct. "
ActiveWindow.View.ShowRevisionsAndComments = True
Case "Chicago_comments_4"
selection.Range.HighlightColorIndex = wdYellow
selection.comments.Add Range:=selection.Range, Text:="Please check the accuracy of it, if any problem, please modify."
ActiveWindow.View.ShowRevisionsAndComments = True
End Select
End Sub
Sub jia_and()
Call layout_search_replace.jump_to_reference_section
Dim myrange As Range
Set myrange = ActiveDocument.Range(Start:=selection.Range.Start, End:=ActiveDocument.Range.End)
With myrange.Find
.Text = "&"
.Replacement.Text = "and"
.MatchWildcards = False
.Wrap = wdFindStop
.Forward = True
.Execute Replace:=wdReplaceAll
End With
End Sub
Sub Footnote2Reference(ByVal control As IRibbonControl)
'
Dim i As Integer
Dim oFootNote As Footnote, myrange As Range
Dim BeforeName As String, BeforeSize As Single
On Error Resume Next
Application.ScreenUpdating = False
i = 1
For Each oFootNote In ActiveDocument.Footnotes
With oFootNote
Set myrange = ActiveDocument.Range(.Reference.Start, .Reference.End)
.Range.Copy
With myrange
.Text = "(JZ: )" & "[" & i & "]"
BeforeName = .Font.name
BeforeSize = .Font.Size
myrange.SetRange .Start + 4, .Start + 4
.Paste
.Font.name = BeforeName
.Font.Size = BeforeSize
End With
End With
i = i + 1
Next
Dim j As Integer
j = 1
selection.HomeKey wdStory
With selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\(JZ\:(*)\)(\[[0-9]{1,}\])"
.Replacement.Text = "\1\2"
.MatchWildcards = True
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found Then
selection.Range.HighlightColorIndex = wdYellow
.Execute Replace:=wdReplaceOne
Set myrange = selection.Range
myrange.SetRange selection.Range.Start, selection.Range.Start + InStr(selection.Range, "[") - 1
myrange.Select
selection.Cut
selection.EndKey wdStory
selection.TypeText vbCrLf
selection.Paste
selection.MoveUp wdParagraph, 1
selection.TypeText j & ". "
j = j + 1
End If
selection.HomeKey wdStory
Loop
End With
Application.ScreenUpdating = True
End Sub
Sub name2etal(ByVal control As IRibbonControl)
Dim myrange As Range
selection.HomeKey wdStory
With selection.Find
.Text = "[A-Z][a-z]{1,}\, [A-Z][a-z]{1,}\,[!0-9]{1,}2[0-9]{3}"
.MatchWildcards = True
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindStop
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found Then
If InputBox("Is this a reference call-out? Replace more than one author name to et al?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Range.HighlightColorIndex = wdYellow
Set myrange = selection.Range
myrange.Select
myrange.SetRange selection.Range.Start + InStr(selection.Range, ",") - 1, selection.Range.Start + InStr(selection.Range, "2") - 1
myrange.Text = " et al. "
selection.collapse wdCollapseEnd
End If
End If
Loop
End With
selection.HomeKey wdStory
With selection.Find
.Text = "[A-Z][a-z]{1,}\, [A-Z][a-z]{1,}\,[!0-9]{1,}1[0-9]{3}"
.MatchWildcards = True
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindStop
Do
.Execute
If Not .Found Then
Exit Do
End If
If .Found Then
If InputBox("Is this a reference call-out? Replace more than one author name to et al?", "Possible Reference Call-out Detected", "yes", 300, 300) = "yes" Then
selection.Range.HighlightColorIndex = wdYellow
Set myrange = selection.Range
myrange.Select
myrange.SetRange selection.Range.Start + InStr(selection.Range, ",") - 1, selection.Range.Start + InStr(selection.Range, "1") - 1
myrange.Text = " et al. "
selection.collapse wdCollapseEnd
End If
End If
Loop
End With
End Sub
以上是关于text 芝加哥代码2018年4月4日更新的主要内容,如果未能解决你的问题,请参考以下文章