kerrypnx
11/7/2018 - 7:49 AM

11. 检测补充材料引用或者Suppl. Sec是否遗漏 (The citation of Supplementary Materials is missing/Supplementary Materials section is missing

revise 11-7

Sub equationIsPicture()
Selection.HomeKey wdStory
Dim existSuppl As Boolean
Dim j As Integer
j = 0
 existSuppl = False
 With Selection.Find
    .ClearFormatting
    .Text = "Supplementary Materials:"
    .Font.Bold = -1
    .MatchWildcards = False
    .Replacement.Text = ""
    .Execute
    If .Found Then
        existSuppl = True
    End If
 End With
 
    Selection.HomeKey wdStory
    arr = "[sS]upplementary; Table S[0-9]; Figure S[0-9] "
    suppl = Split(arr, ";")
For i = LBound(suppl) To UBound(suppl)
    With Selection.Find
        .Text = suppl(i)
        .Font.Bold = 0
        .MatchWildcards = True
        Do
        .Execute
            If Not .Found Then
                Exit Do
                
            Else
               j = j + 1
        Loop
    End With
 Next
If j > 0 And existSuppl = False Then
    Call gotoSuppl
    Selection.comments.Add Selection.Range, "Supplementary Materials section is missing"
End If
If j = 0 And existSuppl = True Then
    Call gotoSuppl
    Selection.comments.Add Selection.Range, "The citation of Supplementary Materials is missing"
End If
End Sub


Sub gotoSuppl()
    Selection.HomeKey wdStory

 With Selection.Find
    .ClearFormatting
    .Text = "Supplementary Materials:"
    .Font.Bold = -1
    .MatchWildcards = False
    .Replacement.Text = ""
    .Execute
    
 End With
End Sub