⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 电力机车牵引变压器试验站总控程序
💻 BAS
📖 第 1 页 / 共 5 页
字号:
        dlgSS6BTesttype.ProgressBar6.Max = count
    ElseIf ttrain = "400" Then
        templateFile = App.Path & "\模版\SS7.doc"
        dlgSS7Testtype.ProgressBar4.Max = count
    ElseIf ttrain = "500" Then
        templateFile = App.Path & "\模版\SS7C.doc"
        dlgSS7CTesttype.ProgressBar4.Max = count
    ElseIf ttrain = "600" Then
        templateFile = App.Path & "\模版\SS7D.doc"
        dlgSS7DTesttype.ProgressBar4.Max = count
    ElseIf ttrain = "700" Then
        templateFile = App.Path & "\模版\SS7E.doc"
        dlgSS7ETesttype.ProgressBar4.Max = count
    ElseIf ttrain = "800" And savewordTestType = 0 Then
        templateFile = App.Path & "\模版\模块SS7E.doc"
        dlgMSS7ETesttype.ProgressBar4.Max = count
    ElseIf ttrain = "800" And savewordTestType = 1 Then
        templateFile = App.Path & "\模版\模块SS7E互感器.doc"
        dlgMSS7ETesttype.ProgressBar4.Max = count
    ElseIf ttrain = "900" Then
        templateFile = App.Path & "\模版\先锋号.doc"
        dlgXFHTesttype.ProgressBar4.Max = count
    ElseIf ttrain = "1000" Then
        templateFile = App.Path & "\模版\200km交流动车.doc"
        dlg200KmTesttype.ProgressBar4.Max = count
    ElseIf ttrain = "1100" Then
        templateFile = App.Path & "\模版\270km空心轴动车.doc"
        dlg270KmTesttype.ProgressBar4.Max = count
    End If

    wrd.Documents.Open templateFile

    Dim temp(39, 2) As Long

    
    For i = 0 To 39
        temp(i, 0) = savewordIndexandLength(i, 0)
        temp(i, 1) = savewordIndexandLength(i, 1)
        temp(i, 2) = savewordIndexandLength(i, 2)
    Next i
        
    For i1 = 0 To count - 1
        If ttrain = "100" And savewordTestType = 0 Then
            dlgSS3BTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "100" And savewordTestType = 1 Then
            dlgSS3BTesttype.ProgressBar5.Value = i1
        ElseIf ttrain = "100" And savewordTestType = 2 Then
            dlgSS3BTesttype.ProgressBar6.Value = i1
        ElseIf ttrain = "200" Then
            dlgSS4GTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "300" And savewordTestType = 0 Then
            dlgSS6BTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "300" And savewordTestType = 2 Then
            dlgSS6BTesttype.ProgressBar5.Value = i1
        ElseIf ttrain = "300" And savewordTestType = 3 Then
            dlgSS6BTesttype.ProgressBar6.Value = i1
        ElseIf ttrain = "400" Then
            dlgSS7Testtype.ProgressBar4.Value = i1
        ElseIf ttrain = "500" Then
            dlgSS7CTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "600" Then
            dlgSS7DTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "700" Then
            dlgSS7ETesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "800" Then
            dlgMSS7ETesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "900" Then
            dlgXFHTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "1000" Then
            dlg200KmTesttype.ProgressBar4.Value = i1
        ElseIf ttrain = "1100" Then
            dlg270KmTesttype.ProgressBar4.Value = i1
        End If
        
        If temp(i1, 2) = 0 Then
            x = 100000 + temp(i1, 0)
        ElseIf temp(i1, 2) = 1 Then
            x = 200000 + temp(i1, 0)
        ElseIf temp(i1, 2) = 2 Then
            x = 300000 + temp(i1, 0)
        ElseIf temp(i1, 2) = 3 Then
            x = 400000 + temp(i1, 0)
        ElseIf temp(i1, 2) = 4 Then
            x = 500000 + temp(i1, 0)
        End If
        Y = x
        For i = 0 To temp(i1, 1) - 1
            wrd.Selection.Find.ClearFormatting
            wrd.Selection.Find.Replacement.ClearFormatting
            If temp(i1, 2) = 0 Then
                With wrd.Selection.Find
                    .Wrap = 1
                    .Text = Y
                    .Replacement.Text = byqData(temp(i1, 0))
                    .Forward = True
                    .Format = False
                    .MatchCase = False
                    .MatchWholeWord = False
                    .MatchByte = True
                    .MatchWildcards = False
                    .MatchSoundsLike = False
                    .MatchAllWordForms = False
                End With
            ElseIf temp(i1, 2) = 1 Then
                With wrd.Selection.Find
                    .Wrap = 1
                    .Text = Y
                    .Replacement.Text = hgqData(temp(i1, 0))
                    .Forward = True
                    .Format = False
                    .MatchCase = False
                    .MatchWholeWord = False
                    .MatchByte = True
                    .MatchWildcards = False
                    .MatchSoundsLike = False
                    .MatchAllWordForms = False
                End With
            ElseIf temp(i1, 2) = 2 Then
                With wrd.Selection.Find
                    .Wrap = 1
                    .Text = Y
                    .Replacement.Text = dkqData(temp(i1, 0))
                    .Forward = True
                    .Format = False
                    .MatchCase = False
                    .MatchWholeWord = False
                    .MatchByte = True
                    .MatchWildcards = False
                    .MatchSoundsLike = False
                    .MatchAllWordForms = False
                End With
            ElseIf temp(i1, 2) = 3 Then
                With wrd.Selection.Find
                    .Wrap = 1
                    .Text = Y
                    .Replacement.Text = dkqData(temp(i1, 0) + 67)
                    .Forward = True
                    .Format = False
                    .MatchCase = False
                    .MatchWholeWord = False
                    .MatchByte = True
                    .MatchWildcards = False
                    .MatchSoundsLike = False
                    .MatchAllWordForms = False
                End With
            ElseIf temp(i1, 2) = 4 Then
                With wrd.Selection.Find
                    .Wrap = 1
                    .Text = Y
                    .Replacement.Text = dkqData(temp(i1, 0) + 134)
                    .Forward = True
                    .Format = False
                    .MatchCase = False
                    .MatchWholeWord = False
                    .MatchByte = True
                    .MatchWildcards = False
                    .MatchSoundsLike = False
                    .MatchAllWordForms = False
                End With
            End If
            wrd.Selection.Find.Execute Replace:=2
            temp(i1, 0) = temp(i1, 0) + 1
            Y = Y + 1
        Next i
    Next i1
    
    wrd.ActiveDocument.SaveAs FileName:=dataFile, FileFormat:= _
        wdFormatDocument, LockComments:=False, password:="", AddToRecentFiles:= _
        True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
        False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
        SaveAsAOCELetter:=False
    
    wrd.Documents.Close SaveChanges:=wdDoNotSaveChanges
    wrd.Quit
    Set wrd = Nothing
    Exit Sub
    
DocError:
    If Err.Number <> 0 Then MsgBox Err.Description
        Set wrd = Nothing
        Exit Sub
    Resume
End Sub

Sub savebyqSS3BWord()
    Dim Index As Integer
    For Index = 225 To 237
        If byqData(Index) = "未完成" Then
            byqData(238) = "未完成"
            Exit For
        Else
            byqData(238) = "完成"
        End If
    Next Index
    
    For Index = 0 To 39
        savewordIndexandLength(Index, 0) = 999
    Next Index
    
    savewordTestType = 0
    
    For Index = 0 To 13
        savewordIndexandLength(Index, 2) = 0
    Next Index
    
    savewordIndexandLength(0, 0) = 5
    savewordIndexandLength(0, 1) = 5
    
    savewordIndexandLength(1, 0) = 15
    savewordIndexandLength(1, 1) = 1
    
    savewordIndexandLength(2, 0) = 16
    savewordIndexandLength(2, 1) = 22
    
    savewordIndexandLength(3, 0) = 40
    savewordIndexandLength(3, 1) = 2
    
    savewordIndexandLength(4, 0) = 45
    savewordIndexandLength(4, 1) = 31
    
    savewordIndexandLength(5, 0) = 76
    savewordIndexandLength(5, 1) = 13
    
    savewordIndexandLength(6, 0) = 107
    savewordIndexandLength(6, 1) = 8
    
    savewordIndexandLength(7, 0) = 115
    savewordIndexandLength(7, 1) = 4
    
    savewordIndexandLength(8, 0) = 122
    savewordIndexandLength(8, 1) = 7
    
    savewordIndexandLength(9, 0) = 129
    savewordIndexandLength(9, 1) = 6
    
    savewordIndexandLength(10, 0) = 135
    savewordIndexandLength(10, 1) = 10
    
    savewordIndexandLength(11, 0) = 168
    savewordIndexandLength(11, 1) = 99
    
    savewordIndexandLength(12, 0) = 145
    savewordIndexandLength(12, 1) = 11
    
    savewordIndexandLength(13, 0) = 2
    savewordIndexandLength(13, 1) = 3
    
    Call saveWord
    
End Sub

Sub savehgqSS3BWord()
    Dim Index As Integer
    For Index = 16 To 20
        If hgqData(Index) = "未完成" Then
            hgqData(21) = "未完成"
            Exit For
        Else
            hgqData(21) = "完成"
        End If
    Next Index
    
    For Index = 0 To 39
        savewordIndexandLength(Index, 0) = 999
    Next Index
    
    savewordTestType = 1
    
    For Index = 0 To 5
        savewordIndexandLength(Index, 2) = 1
    Next Index
    
    savewordIndexandLength(0, 0) = 2
    savewordIndexandLength(0, 1) = 3
    
    savewordIndexandLength(1, 0) = 5
    savewordIndexandLength(1, 1) = 1
    
    savewordIndexandLength(2, 0) = 6
    savewordIndexandLength(2, 1) = 3
    
    savewordIndexandLength(3, 0) = 9
    savewordIndexandLength(3, 1) = 1
    
    savewordIndexandLength(4, 0) = 10
    savewordIndexandLength(4, 1) = 4
    
    savewordIndexandLength(5, 0) = 14
    savewordIndexandLength(5, 1) = 2

    Call saveWord
End Sub

Sub savedkqSS3BWord()
    Dim Index As Integer
    For Index = 65 To 70
        If dkqData(Index) = "未完成" Then
            dkqData(70) = "未完成"
            dkqData(206) = "未完成"
            Exit For
        Else
            dkqData(70) = "完成"
        End If
    Next Index
    
    For Index = 132 To 137
        If dkqData(Index) = "未完成" Then
            dkqData(138) = "未完成"
            dkqData(206) = "未完成"
            Exit For
        Else
            dkqData(138) = "完成"
        End If
    Next Index
    
    For Index = 199 To 204
        If dkqData(Index) = "未完成" Then
            dkqData(205) = "未完成"
            dkqData(206) = "未完成"
            Exit For
        Else
            dkqData(205) = "完成"
        End If
    Next Index
    
    If dkqData(70) = "完成" And dkqData(138) = "完成" And dkqData(205) = "完成" Then
        dkqData(206) = "完成"
    End If
    
    For Index = 0 To 39
        savewordIndexandLength(Index, 0) = 999
    Next Index
    
    savewordTestType = 2
    
    For Index = 0 To 5
        savewordIndexandLength(Index, 2) = 2
    Next Index
    
    savewordIndexandLength(0, 0) = 2
    savewordIndexandLength(0, 1) = 3
    
    savewordIndexandLength(1, 0) = 5
    savewordIndexandLength(1, 1) = 4
    
    savewordIndexandLength(2, 0) = 11
    savewordIndexandLength(2, 1) = 4
    
    savewordIndexandLength(3, 0) = 31
    savewordIndexandLength(3, 1) = 4
    
    savewordIndexandLength(4, 0) = 39
    savewordIndexandLength(4, 1) = 1
    
    savewordIndexandLength(5, 0) = 43
    savewordIndexandLength(5, 1) = 2
    
    Call saveWord
End Sub

Sub saveSS4GWord()
    Dim Index As Integer
    For Index = 225 To 237
        If byqData(Index) = "未完成" Then
            byqData(238) = "未完成"
            Exit For
        Else
            byqData(238) = "完成"
        End If
    Next Index
    
    For Index = 65 To 70
        If dkqData(Index) = "未完成" Then
            dkqData(70) = "未完成"
            dkqData(206) = "未完成"
            Exit For
        Else
            dkqData(70) = "完成"
        End If
    Next Index
    
    For Index = 132 To 137
    If dkqData(Index) = "未完成" Then
        dkqData(138) = "未完成"
        dkqData(206) = "未完成"
        Exit For
    Else
        dkqData(138) = "完成"
    End If
    Next Index
    
    For Index = 199 To 204
    If dkqData(Index) = "未完成" Then
        dkqData(205) = "未完成"
        dkqData(206) = "未完成"
        Exit For
    Else
        dkqData(205) = "完成"
    End If
    Next Index
    
    If dkqData(70) = "完成" And dkqData(138) = "完成" And dkqData(205) = "完成" Then
        dkqData(206) = "完成"
    End If
    
    For Index = 0 To 39
        savewordIndexandLength(Index, 0) = 999
    Next Index
    
    For Index = 0 To 13
        savewordIndexandLength(Index, 2) = 0
    Next Index
    
    savewordIndexandLength(0, 0) = 5
    savewordIndexandLength(0, 1) = 4
    
    savewordIndexandLength(1, 0) = 15
    savewordIndexandLength(1, 1) = 1
    
    savewordIndexandLength(2, 0) = 16
    savewordIndexandLength(2, 1) = 18
    
    savewordIndexandLength(3, 0) = 40
    savewordIndexandLength(3, 1) = 1
    
    savewordIndexandLength(4, 0) = 45
    savewordIndexandLength(4, 1) = 31
    
    savewordIndexandLength(5, 0) = 76
    savewordIndexandLength(5, 1) = 18
    
    savewordIndexandLength(6, 0) = 115
    savewordIndexandLength(6, 1) = 5
    
    savewordIndexandLength(7, 0) = 122
    savewordIndexandLength(7, 1) = 7
    
    savewordIndexandLength(8, 0) = 129
    savewordIndexandLength(8, 1) = 6
    
    savewordIndexandLength(9, 0) = 107
    savewordIndexandLength(9, 1) = 8
    
    savewordIndexandLength(10, 0) = 135
    savewordIndexandLength(10, 1) = 10
    
    savewordIndexandLength(11, 0) = 145
    savewordIndexandLength(11, 1) = 11
    
    savewordIndexandLength(12, 0) = 168
    savewordIndexandLength(12, 1) = 120
    
    savewordIndexandLength(13, 0) = 2
    savewordIndexandLength(13, 1) = 3
    
    For Index = 14 To 18
        savewordIndexandLength(Index, 2) = 2
    Next Index
    
    savewordIndexandLength(14, 0) = 5
    savewordIndexandLength(14, 1) = 1
    
    savewordIndexandLength(15, 0) = 11
    savewordIndexandLength(15, 1) = 13
    
    savewordIndexandLength(16, 0) = 39
    savewordIndexandLength(16, 1) = 4

    savewordIndexandLength(17, 0) = 43
    savewordIndexandLength(17, 1) = 8
    
    savewordIndexandLength(18, 0) = 59

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -