?? form4.frm
字號:
VERSION 5.00
Begin VB.Form Form4
Caption = "還有45分鐘結(jié)束考試"
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 ' 每秒發(fā)生一次Timer事件
End Sub
Private Sub Timer1_Timer()
lTime = lTime - 1
Me.Caption = "還有" + Str(lTime) + "分鐘結(jié)束考試"
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
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -