📄 frmlogon.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
Caption = "VB Mail"
ClientHeight = 6675
ClientLeft = 1410
ClientTop = 1605
ClientWidth = 9540
LinkTopic = "Form1"
NegotiateMenus = 0 'False
ScaleHeight = 6675
ScaleWidth = 9540
Begin MSComctlLib.Toolbar tbrMail
Align = 1 'Align Top
Height = 615
Left = 0
TabIndex = 2
Top = 0
Width = 9540
_ExtentX = 16828
_ExtentY = 1085
ButtonWidth = 2090
ButtonHeight = 926
Appearance = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 8
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Log On"
Key = "LogOn"
Description = "Log on"
Object.ToolTipText = "Log On"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "Log Off"
Key = "logOff"
Description = "Log off"
Object.ToolTipText = "Log Off"
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 = "Fetch"
Key = "fetch"
Description = "Fetch unread messages"
Object.ToolTipText = "Fetch unread messages"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "Address Book"
Key = "address"
Description = "Show Address Book"
Style = 5
BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
NumButtonMenus = 2
BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "global"
Text = "Global"
EndProperty
BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "recepient"
Text = "Recepient"
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 = "Compose"
Key = "compose"
Description = "Compose messages"
Object.ToolTipText = "Compose new message"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList imlMail
Left = 240
Top = 5160
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
End
Begin MSDataGridLib.DataGrid grdMess
Height = 3780
Left = 60
TabIndex = 1
Top = 1155
Width = 9435
_ExtentX = 16642
_ExtentY = 6668
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
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.StatusBar sbrMapi
Align = 2 'Align Bottom
Height = 255
Left = 0
TabIndex = 0
Top = 6420
Width = 9540
_ExtentX = 16828
_ExtentY = 450
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin MSMAPI.MAPIMessages mapMess
Left = 615
Top = 615
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
AddressEditFieldCount= 1
AddressModifiable= 0 'False
AddressResolveUI= 0 'False
FetchSorted = 0 'False
FetchUnreadOnly = 0 'False
End
Begin MSMAPI.MAPISession mapSess
Left = -45
Top = 570
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DownloadMail = -1 'True
LogonUI = -1 'True
NewSession = 0 'False
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuMail
Caption = "&Mail"
Begin VB.Menu mnuLogOn
Caption = "Log O&n"
End
Begin VB.Menu mnuLogOff
Caption = "Log O&ff"
Enabled = 0 'False
End
End
Begin VB.Menu mnuTools
Caption = "&Tools"
Enabled = 0 'False
Begin VB.Menu mnuCheck
Caption = "&Check for New Mail"
Enabled = 0 'False
Shortcut = {F5}
End
Begin VB.Menu mnuAddress
Caption = "Address Book"
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 ' Flag to signal logon status.
' Set the gbIgnoreEvent to True whenever you are
' about to do an operation that causes the DataGrid
' control's BeforeColEdit event to occur. When True,
' the event will exit without further execution.
Private gbIgnoreEvent As Boolean
Private WithEvents rsUnread As ADODB.Recordset
Attribute rsUnread.VB_VarHelpID = -1
Private gbGridConfigured As Boolean ' Flag to configure DataGrid
Private gbRSalreadyPopulated As Boolean ' Flag to signal RS populated
Private Sub Form_Load()
' Configure StatusBar.
sbrMapi.Panels(1).Key = "SessID"
sbrMapi.Panels.Add , "MsgCnt" ' Add Panel
End Sub
Private Sub tbrMail_ButtonClick(ByVal Button As MSComCtlLib.Button)
' Use Select Case statement to determine which button
' was clicked, then react appropriately.
On Error GoTo ButtonErr
Select Case Button.Key
Case "LogOn"
' Log and fetch unread messages. CheckRS checks
' if the ADORecordset has already been populated,
' and populates it if needed. DoGrid configures the
' grid and populates with the recordset.
If LogOn = True Then
FetchUnreadOnly
CheckRS
DoGrid
Else
Exit Sub
End If
Case "logOff" ' Log off
LogOff
Case "fetch"
FetchUnreadOnly
' Check to see if the ADO Recordset is
' already populated. Then populate grid.
CheckRS
DoGrid
Case "compose" ' Create a new message.
ComposeMessage
Case "address"
Debug.Print "something else"
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)
If mapSess.SessionID = 0 Or mapMess.MsgCount = 0 Then Exit Sub
grdMess.Row = grdMess.RowContaining(Y)
If gbIgnoreEvent Then Exit Sub
On Error GoTo RowERR
mapMess.MsgIndex = grdMess.Columns(0).Value ' Set MsgIndex.
Load frmRead ' Load the form.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -