vbscript 检测表/图/方案引用顺序

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript 检测表/图/方案引用顺序相关的知识,希望对你有一定的参考价值。

Sub citationOrder()
Dim currNum, lastCall As Integer
lastCall = 0
Selection.HomeKey wdStory
arr = "<Table [0-9]{1,}>;<Figure [0-9]{1,}>;<Scheme [0-9]{1,}>"
aimT = Split(arr, ";")
For i = 0 To UBound(aimT)
    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Font.Bold = False
        .Text = aimT(i)
        .Format = True
        .Forward = True
        .Wrap = wdFindStop
        .MatchWildcards = True
        Do
            .Execute
            If Not .Found Then
                Exit Do
            ElseIf .Found Then
                currNum = FunctionGroup.getNum(Selection.Text)
                If currNum - lastCall > 0 Then
                    If currNum - lastCall <> 1 Then
                    lastCall = currNum
                        If j = 0 Then
                            Selection.Range.HighlightColorIndex = wdRed
                            Selection.Range.comments.Add Selection.Range, "Detect that no " + Left(Selection.Text, InStr(Selection.Text, " ")) + "citation is before " + Selection.Text + " Please check if the " + Left(Selection.Text, InStr(Selection.Text, " ")) + "order is correct."
                            lastCall = 1
                        Else
                            Selection.Range.HighlightColorIndex = wdRed
                            Selection.Range.comments.Add Selection.Range, "Detect " + Selection.Text + " is after of " + Left(Selection.Text, InStr(Selection.Text, " ")) + CStr(preNum) + " Please check if the " + Left(Selection.Text, InStr(Selection.Text, " ")) + "order is correct."
                        End If
                    End If
                    preNum = currNum
                End If
                
            End If
            j = j + 1
        Loop
    End With
Next
End Sub

以上是关于vbscript 检测表/图/方案引用顺序的主要内容,如果未能解决你的问题,请参考以下文章

vbscript 7.检测图/表/方案是否多引漏引,提及在图片/表格后面也需提醒

vbscript 检测摘要里是否出现网址,文献引用,公式,图,表等的提及

vbscript 8.检测方程是否按顺序编号,是否重复编号

vbscript 11.检测补充材料引用或者增刊。 Sec是否遗漏(缺少补充材料的引用/补充材料部分缺失

vbscript 和 vb.net 有啥区别?

vbscript 检测是否有子表