📄 11-3.frm
字号:
VERSION 5.00
Object = "{20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0"; "MSMAPI32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "E-Mail 演示程序"
ClientHeight = 5280
ClientLeft = 1395
ClientTop = 1590
ClientWidth = 7020
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
NegotiateMenus = 0 'False
ScaleHeight = 5280
ScaleWidth = 7020
Begin MSComctlLib.ImageList imlMail
Left = 1560
Top = 4275
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
End
Begin MSMAPI.MAPISession mapSess
Left = 4680
Top = 120
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DownloadMail = -1 'True
LogonUI = -1 'True
NewSession = 0 'False
End
Begin MSMAPI.MAPIMessages mapMess
Left = 3960
Top = 120
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
AddressEditFieldCount= 1
AddressModifiable= 0 'False
AddressResolveUI= 0 'False
FetchSorted = 0 'False
FetchUnreadOnly = 0 'False
End
Begin MSDataGridLib.DataGrid grdMess
Height = 4410
Left = 60
TabIndex = 1
Top = 600
Width = 6915
_ExtentX = 12197
_ExtentY = 7779
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 0
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 0
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
MarqueeStyle = 1
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar tbrMail
Align = 1 'Align Top
Height = 555
Left = 0
TabIndex = 2
Top = 0
Width = 7020
_ExtentX = 12383
_ExtentY = 979
ButtonWidth = 1138
ButtonHeight = 926
Appearance = 1
Style = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 8
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "登录"
Key = "LogOn"
Description = "登录"
Object.ToolTipText = "登录"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "注销"
Key = "logOff"
Description = "注销"
Object.ToolTipText = "注销"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Style = 4
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "取邮件"
Key = "fetch"
Description = "取未读信息"
Object.ToolTipText = "取未读邮件"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "地址簿"
Key = "address"
Description = "显示地址簿"
Style = 5
BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
NumButtonMenus = 2
BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "global"
Text = "全部"
EndProperty
BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "recepient"
Text = "最新"
EndProperty
EndProperty
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Style = 4
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "新邮件"
Key = "compose"
Description = "撰写信息"
Object.ToolTipText = "撰写新的信息"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar sbrMapi
Align = 2 'Align Bottom
Height = 255
Left = 0
TabIndex = 0
Top = 5025
Width = 7020
_ExtentX = 12383
_ExtentY = 450
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Menu mnuFile
Caption = "文件(&F)"
Begin VB.Menu mnuExit
Caption = "退出(&X)"
End
End
Begin VB.Menu mnuMail
Caption = "邮件(&M)"
Begin VB.Menu mnuLogOn
Caption = "登录(&N)"
End
Begin VB.Menu mnuLogOff
Caption = "注销(&F)"
Enabled = 0 'False
End
End
Begin VB.Menu mnuTools
Caption = "工具(&T)"
Enabled = 0 'False
Begin VB.Menu mnuCheck
Caption = "检查新邮件(&C)"
Enabled = 0 'False
Shortcut = {F5}
End
Begin VB.Menu mnuAddress
Caption = "地址簿"
Enabled = 0 'False
Shortcut = ^{F1}
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private bNewSession As Boolean ' 登录状态的标志。
' 每当您执行一个导致 DataGrid 控件的
' BeforeColEdit 事件发生的操作
' 设置 gbIgnoreEvent 为真,这样
' 此事件将不再执行其他操作而退出。
Private gbIgnoreEvent As Boolean
Private WithEvents rsUnread As ADODB.Recordset
Attribute rsUnread.VB_VarHelpID = -1
Private gbGridConfigured As Boolean ' 配置 DataGrid 标志
Private gbRSalreadyPopulated As Boolean ' RS 准备好标志
Private Sub Form_Load()
' 配置状态栏
sbrMapi.Panels(1).Key = "SessID"
sbrMapi.Panels.Add , "MsgCnt" ' 添加窗格
End Sub
Private Sub tbrMail_ButtonClick(ByVal Button As MSComCtlLib.Button)
' 使用 Select Case 语句判断按钮按下,
' 并适当响应。
On Error GoTo ButtonErr
Select Case Button.Key
Case "LogOn"
' 登录并取未读信息。 CheckRS 将检查
' ADORecordset 是否已经准备好
' DoGrid 配置窗格
If LogOn = True Then
FetchUnreadOnly
CheckRS
DoGrid
Else
Exit Sub
End If
Case "logOff" ' 注销
LogOff
Case "fetch"
FetchUnreadOnly
' 检查 ADO Recordset。
CheckRS
DoGrid
Case "compose" ' 创建新的信息
ComposeMessage
Case "address"
mapMess.Show False
Case Else
Debug.Print Button.Key
End Select
Exit Sub
ButtonErr:
Debug.Print Err.Number, Err.Description
Resume Next
End Sub
Private Sub grdMess_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -