?? frmprint.frm
字號:
VERSION 5.00
Begin VB.Form frmPrint
BackColor = &H00C0C000&
Caption = "個人簡歷打印"
ClientHeight = 2700
ClientLeft = 60
ClientTop = 348
ClientWidth = 3792
Icon = "frmPrint.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2700
ScaleWidth = 3792
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdExit
Caption = "退出"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1050
TabIndex = 2
Top = 1890
Width = 1575
End
Begin VB.TextBox txtPrint
BackColor = &H00C0C0FF&
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1050
TabIndex = 1
Text = "6601039"
Top = 450
Width = 1575
End
Begin VB.CommandButton cmdPrint
Caption = "打印"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1050
TabIndex = 0
Top = 1170
Width = 1575
End
End
Attribute VB_Name = "frmPrint"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Me.Hide
Unload Me
frmMDI.Show
End Sub
Private Sub cmdPrint_Click()
Dim Word As Object
Dim recPrint As Recordset
Dim sqlPrint As String
Dim XH As String
Dim XM As String
Dim CSNY As String
Dim XB As String
Dim MZ As String
Dim YX As String
Dim SY As String
Dim ZZMM As String
Dim ZY As String
Dim PYFS As String
Dim JZXM1 As String
Dim DW1 As String
Dim JZXM2 As String
Dim DW2 As String
Screen.MousePointer = vbHourglass
sqlPrint = "select zbqkb.xh ,zbqkb.xm ,zbqkb.csny ,zbqkb.xb,zbqkb.mz,zbqkb.yx,zbqkb.sy,zbqkb.zzmm,zbqkb.zy,zbqkb.pyfs,jtqkb.jzxm1,jtqkb.dw1,jtqkb.jzxm2,jtqkb.dw2 from zbqkb,jtqkb where zbqkb.xh='" + Trim(txtPrint) + "'"
Set recPrint = dbStudent.OpenRecordset(sqlPrint, dbOpenSnapshot)
If recPrint.RecordCount = 0 Then
MsgBox "無記錄"
Screen.MousePointer = vbArrow
Exit Sub
End If
If IsNull(recPrint!XH) Then
MsgBox "無學號"
Screen.MousePointer = vbArrow
Exit Sub
Else
XH = CStr(recPrint!XH)
End If
If IsNull(recPrint!XM) Then
MsgBox "無姓名"
Screen.MousePointer = vbArrow
Else
XM = CStr(recPrint!XM)
End If
If IsNull(recPrint!CSNY) Then
CSNY = "??-??-??"
Else
CSNY = CStr(recPrint!CSNY)
End If
If IsNull(recPrint!XB) Then
XB = ""
Else
XB = CStr(recPrint!XB)
End If
If IsNull(recPrint!YX) Then
YX = ""
Else
YX = CStr(recPrint!YX)
End If
If IsNull(recPrint!SY) Then
SY = ""
Else
SY = CStr(recPrint!SY)
End If
If IsNull(recPrint!ZZMM) Then
ZZMM = ""
Else
ZZMM = CStr(recPrint!ZZMM)
End If
If IsNull(recPrint!MZ) Then
MZ = ""
Else
MZ = CStr(recPrint!MZ)
End If
If IsNull(recPrint!ZY) Then
ZY = ""
Else
ZY = CStr(recPrint!ZY)
End If
If IsNull(recPrint!PYFS) Then
PYFS = ""
Else
PYFS = CStr(recPrint!PYFS)
End If
If IsNull(recPrint!JZXM1) Then
JZXM1 = ""
Else
JZXM1 = CStr(recPrint!JZXM1)
End If
If IsNull(recPrint!DW1) Then
DW1 = ""
Else
DW1 = CStr(recPrint!DW1)
End If
If IsNull(recPrint!JZXM2) Then
JZXM2 = ""
Else
JZXM2 = CStr(recPrint!JZXM2)
End If
If IsNull(recPrint!DW2) Then
DW2 = ""
Else
DW2 = CStr(recPrint!DW2)
End If
Set Word = CreateObject("word.basic")
With Word
.filenew
.startofdocument
.formatfont Points:="18", Font:="Times New Roman", Bold:=1, Italic:=0
.centerpara
.Insert "" + Trim(XM) + "" & "同學個人情況"
.insertpara
.formatfont Points:="14", Font:="宋體"
.normalstyle
.Insert "學號"
.Insert " "
.Insert XH
.Insert " "
.Insert "姓名"
.Insert " "
.Insert XM
.Insert " "
.Insert "出生年月"
.Insert " "
.Insert CSNY
.insertpara
.Insert "性別"
.Insert " "
.Insert XB
.Insert " "
.Insert "民族"
.Insert " "
.Insert MZ
.Insert " "
.Insert "院系"
.Insert " "
.Insert YX
.Insert " "
.Insert "專業"
.Insert " "
.Insert ZY
.insertpara
.Insert "生源"
.Insert " "
.Insert SY
.Insert " "
.Insert "政治面貌"
.Insert " "
.Insert ZZMM
.Insert " "
.Insert "培養方式"
.Insert " "
.Insert PYFS
.insertpara
.Insert "家長姓名1"
.Insert " "
.Insert JZXM1
.Insert " "
.Insert "單位1"
.Insert " "
.Insert DW1
.insertpara
.Insert "家長姓名2"
.Insert " "
.Insert JZXM2
.Insert " "
.Insert "單位2"
.Insert " "
.Insert DW2
.insertpara
.appshow
End With
Screen.MousePointer = vbArrow
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -