Sub 调整作者名和姓顺序()
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