📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
Caption = "还有45分钟结束考试"
ClientHeight = 5430
ClientLeft = 165
ClientTop = 495
ClientWidth = 8745
LinkTopic = "Form4"
ScaleHeight = 5430
ScaleWidth = 8745
StartUpPosition = 2 '屏幕中心
Visible = 0 'False
Begin VB.CommandButton Command9
Caption = "退出"
Height = 495
Left = 7680
TabIndex = 9
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.CommandButton Command7
Caption = "电子表格"
Height = 495
Left = 4800
TabIndex = 7
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.CommandButton Command6
Caption = "演示文稿"
Height = 495
Left = 5760
TabIndex = 6
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.CommandButton Command5
Caption = "汉字录入"
Height = 495
Left = 2880
TabIndex = 5
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.CommandButton Command4
Caption = "基本操作"
Height = 495
Left = 1920
TabIndex = 4
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.CommandButton Command3
Caption = "交卷评分"
Height = 495
Left = 6720
TabIndex = 3
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.TextBox Text1
DataField = "nr"
DataSource = "Adodc1"
Height = 3855
Left = 360
MultiLine = -1 'True
TabIndex = 2
Top = 960
Width = 8055
End
Begin VB.CommandButton Command2
Caption = "选择题"
Height = 495
Left = 960
TabIndex = 1
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.CommandButton Command1
Caption = "Word操作"
Height = 495
Left = 3840
TabIndex = 0
TabStop = 0 'False
Top = 240
Width = 975
End
Begin VB.Timer Timer1
Left = 8040
Top = 4920
End
Begin VB.Label Label1
Caption = "考生文件夹 C:\TEXT"
Height = 735
Left = 120
TabIndex = 8
Top = 240
Width = 735
End
Begin VB.Menu 考试项目
Caption = "考试项目"
Begin VB.Menu 选择题
Caption = "选择题"
End
Begin VB.Menu Word操作
Caption = "Word操作"
End
End
Begin VB.Menu 帮助
Caption = "帮助"
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public w As Word.Application
Public d As Document
Public i As String
Public h As Integer
Dim lTime As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim fs As File
Dim ts As TextStream
Dim t As String
Set fs = fso.GetFile(App.path & "\subject.txt")
Set ts = fs.OpenAsTextStream(ForReading)
t = ts.ReadAll
Text1.Text = t
ts.Close
End Sub
Private Sub Command3_Click()
Dim wordfs As String
Dim i As String
i = 0
Set w = CreateObject("word.application")
Set d = w.Documents.Open(App.path & "\答案.doc")
s1 = w.ActiveDocument.Paragraphs(1).Range
s2 = w.ActiveDocument.Paragraphs(1).Range.Font.Size
s3 = w.ActiveDocument.Paragraphs(1).Range.Font.Color
s4 = w.ActiveDocument.Paragraphs(1).Range.Font.Name
p1 = w.ActiveDocument.Paragraphs(2).Range
p2 = w.ActiveDocument.Paragraphs(2).Range.Font.Size
a1 = w.ActiveDocument.Paragraphs(4).Range.Font.Name
a2 = w.ActiveDocument.Paragraphs(4).Range.Font.Bold
n = w.ActiveDocument.Paragraphs(1).Range.Font.Shading.Texture
n1 = w.ActiveDocument.Paragraphs(1).Range.Font.Shading.ForegroundPatternColor
n2 = w.ActiveDocument.Paragraphs(1).Range.Font.Shading.BackgroundPatternColor
n3 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders(1).LineStyle
n4 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders(1).LineWidth
n5 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders(1).Color
n6 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders.Shadow
v = w.ActiveDocument.Paragraphs(5).Range.Font.Underline
Set w = CreateObject("word.application")
path = "C:\TEXT\"
File = path & "作答.doc"
Set d = w.Documents.Open(File, , False)
ss1 = w.ActiveDocument.Paragraphs(1).Range
ss2 = w.ActiveDocument.Paragraphs(1).Range.Font.Size
ss3 = w.ActiveDocument.Paragraphs(1).Range.Font.Color
ss4 = w.ActiveDocument.Paragraphs(1).Range.Font.Name
pp1 = w.ActiveDocument.Paragraphs(2).Range
pp2 = w.ActiveDocument.Paragraphs(2).Range.Font.Size
aa1 = w.ActiveDocument.Paragraphs(4).Range.Font.Name
aa2 = w.ActiveDocument.Paragraphs(4).Range.Font.Bold
nn = w.ActiveDocument.Paragraphs(1).Range.Font.Shading.Texture
nn1 = w.ActiveDocument.Paragraphs(1).Range.Font.Shading.ForegroundPatternColor
nn2 = w.ActiveDocument.Paragraphs(1).Range.Font.Shading.BackgroundPatternColor
nn3 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders(1).LineStyle
nn4 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders(1).LineWidth
nn5 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders(1).Color
nn6 = w.ActiveDocument.Paragraphs(1).Range.Font.Borders.Shadow
vv = w.ActiveDocument.Paragraphs(5).Range.Font.Underline
If s1 = ss1 Then '比较题目
i = i + 5
End If
If s2 = ss2 Then
i = i + 5
End If
If s3 = ss3 Then
i = i + 5
End If
If s4 = ss4 Then
i = i + 5
End If
If s1 = ss1 And s2 = ss2 And s3 = ss3 And s4 = ss4 Then
i = i + 5
End If
If p1 = pp1 And p2 = pp2 Then '比较下沉
i = i + 15
End If
If a1 = aa1 And a2 = aa2 Then
i = i + 10
End If
If n = nn And n1 = nn1 And n2 = nn2 Then
i = i + 15
End If
If n3 = nn3 And n4 = nn4 And n5 = nn5 And n6 = nn6 Then
i = i + 15
End If
If n = nn And n1 = nn1 And n2 = nn2 And n3 = nn3 And n4 = nn4 And n5 = nn5 And n6 = nn6 Then
i = i + 10
End If
If v = vv Then
i = i + 10
End If
h = i
Word.Application.Quit
w.Quit
Set w = Nothing
Form4.Hide
Form5.Show
End Sub
Private Sub Command9_Click()
MsgBox "退出后考生将不能再次进入,是否退出?", vbOKOnly + vbExclamation, "警告"
End
End Sub
Private Sub Form_Load()
lTime = 45 ' 100秒倒计时
Timer1.Interval = 60000 ' 每秒发生一次Timer事件
End Sub
Private Sub Timer1_Timer()
lTime = lTime - 1
Me.Caption = "还有" + Str(lTime) + "分钟结束考试"
If lTime = 0 Then
MsgBox "时间已到!"
End If
End Sub
Private Sub Word操作_Click()
re = ShellExecute(Me.hwnd, "Open", "word.doc", "", App.path, 1)
End Sub
Private Sub 选择题_Click()
re = ShellExecute(Me.hwnd, "Open", "选择题.doc", "", App.path, 1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -