home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin MDIForm VBMAIL
- Caption = "VB Mail"
- ClientHeight = 6090
- ClientLeft = 240
- ClientTop = 975
- ClientWidth = 9195
- Height = 6780
- Icon = VBMAIL.FRX:0000
- Left = 180
- LinkTopic = "MDIForm1"
- Top = 345
- Width = 9315
- Begin PictureBox Picture1
- Align = 2 'Align Bottom
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Enabled = 0 'False
- Height = 345
- Left = 0
- ScaleHeight = 345
- ScaleWidth = 9195
- TabIndex = 0
- Top = 5745
- Width = 9195
- Begin Line MsgBoxSide
- BorderColor = &H00FFFFFF&
- Index = 1
- X1 = 7260
- X2 = 7260
- Y1 = 60
- Y2 = 300
- End
- Begin Line MsgBoxSide
- BorderColor = &H00808080&
- Index = 0
- X1 = 60
- X2 = 60
- Y1 = 60
- Y2 = 300
- End
- Begin Line MsgBoxLine
- BorderColor = &H00FFFFFF&
- Index = 1
- X1 = 60
- X2 = 7260
- Y1 = 300
- Y2 = 300
- End
- Begin Line MsgBoxLine
- BorderColor = &H00808080&
- Index = 0
- X1 = 60
- X2 = 7260
- Y1 = 60
- Y2 = 60
- End
- Begin Line TimeBoxSide
- BorderColor = &H00FFFFFF&
- Index = 1
- X1 = 8580
- X2 = 8580
- Y1 = 60
- Y2 = 300
- End
- Begin Line TimeBoxLine
- BorderColor = &H00FFFFFF&
- Index = 1
- X1 = 7320
- X2 = 8580
- Y1 = 300
- Y2 = 300
- End
- Begin Line TimeBoxSide
- BorderColor = &H00808080&
- Index = 0
- X1 = 7320
- X2 = 7320
- Y1 = 60
- Y2 = 300
- End
- Begin Line TimeBoxLine
- BorderColor = &H00808080&
- Index = 0
- X1 = 7320
- X2 = 8580
- Y1 = 60
- Y2 = 60
- End
- Begin Line TopLine2
- BorderColor = &H00FFFFFF&
- Index = 1
- X1 = 0
- X2 = 10800
- Y1 = 15
- Y2 = 15
- End
- Begin Label UnreadLbl
- BackStyle = 0 'Transparent
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 1800
- TabIndex = 7
- Top = 60
- Width = 1575
- End
- Begin Line TopLine2
- BorderColor = &H00000000&
- Index = 0
- X1 = 0
- X2 = 10800
- Y1 = 0
- Y2 = 0
- End
- Begin Label TimeLbl
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Time"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 205
- Left = 7500
- TabIndex = 10
- Top = 75
- Width = 345
- End
- Begin Label MsgCountLbl
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Message Count Information"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 120
- TabIndex = 11
- Top = 75
- Width = 1935
- End
- End
- Begin PictureBox Picture3
- Align = 1 'Align Top
- Height = 855
- Left = 0
- ScaleHeight = 825
- ScaleWidth = 9165
- TabIndex = 8
- Top = 525
- Visible = 0 'False
- Width = 9195
- Begin MapiMessages MapiMess
- AddressCaption = ""
- AddressEditFieldCount= 0
- AddressLabel = ""
- AddressModifiable= 0 'False
- AddressResolveUI= -1 'True
- FetchMsgType = ""
- FetchSorted = 0 'False
- FetchUnreadOnly = -1 'True
- Left = 1320
- Top = 120
- End
- Begin MapiSession MapiSess
- Action = 0 'Nothing
- DownloadMail = -1 'True
- Left = 720
- LogonUI = -1 'True
- NewSession = 0 'False
- Password = ""
- Top = 120
- UserName = ""
- End
- Begin CommonDialog CMDialog1
- CancelError = -1 'True
- Left = 1920
- Top = 120
- End
- Begin Timer Timer1
- Interval = 15000
- Left = 180
- Top = 120
- End
- Begin Label Label1
- Caption = "These controls are invisible at Runtime"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 315
- Left = 2700
- TabIndex = 9
- Top = 300
- Width = 2835
- End
- End
- Begin PictureBox Picture2
- Align = 1 'Align Top
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 525
- Left = 0
- ScaleHeight = 525
- ScaleWidth = 9195
- TabIndex = 12
- Top = 0
- Width = 9195
- Begin CommandButton Delete
- Caption = "&Delete"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Left = 4980
- TabIndex = 4
- Top = 90
- Width = 1035
- End
- Begin CommandButton Next
- Caption = "&Next"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Left = 7440
- TabIndex = 6
- Top = 90
- Width = 1035
- End
- Begin CommandButton Previous
- Caption = "&Previous"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Left = 6420
- TabIndex = 5
- Top = 90
- Width = 1035
- End
- Begin CommandButton SendCtl
- Caption = "&Forward"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Index = 9
- Left = 3600
- TabIndex = 3
- Top = 90
- Width = 1035
- End
- Begin CommandButton SendCtl
- Caption = "Reply &All"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Index = 8
- Left = 2580
- TabIndex = 2
- Top = 90
- Width = 1035
- End
- Begin CommandButton SendCtl
- Caption = "&Reply"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Index = 7
- Left = 1560
- TabIndex = 1
- Top = 90
- Width = 1035
- End
- Begin CommandButton SendCtl
- Caption = "&Compose"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Index = 6
- Left = 180
- TabIndex = 13
- Top = 90
- Width = 1035
- End
- Begin Line TopLine
- BorderColor = &H00000000&
- Index = 1
- X1 = 15
- X2 = 10800
- Y1 = 505
- Y2 = 505
- End
- Begin Line Line1
- BorderColor = &H00FFFFFF&
- X1 = 0
- X2 = 0
- Y1 = 0
- Y2 = 540
- End
- Begin Line TopLine
- BorderColor = &H00FFFFFF&
- Index = 0
- X1 = 0
- X2 = 10800
- Y1 = 0
- Y2 = 0
- End
- End
- Begin Menu FileMenu
- Caption = "&File"
- Begin Menu PrintMessage
- Caption = "&Print Message"
- Enabled = 0 'False
- End
- Begin Menu PrSetup
- Caption = "Prin&ter Setup..."
- End
- Begin Menu sep
- Caption = "-"
- End
- Begin Menu Exit
- Caption = "E&xit"
- End
- End
- Begin Menu EditMenu
- Caption = "&Edit"
- Begin Menu EditDelete
- Caption = "Delete"
- Enabled = 0 'False
- End
- End
- Begin Menu Mail
- Caption = "&Mail"
- Begin Menu Logon
- Caption = "Lo&gon"
- End
- Begin Menu LogOff
- Caption = "Log&off"
- Enabled = 0 'False
- End
- Begin Menu sep2
- Caption = "-"
- End
- Begin Menu rMsgList
- Caption = "Update Message List"
- Enabled = 0 'False
- End
- End
- Begin Menu Options
- Caption = "&Options"
- Begin Menu MailOpts
- Caption = "&Mail..."
- End
- Begin Menu FontS
- Caption = "&Fonts"
- Begin Menu FontScreen
- Caption = "&Screen..."
- End
- Begin Menu FontPrt
- Caption = "&Printer..."
- End
- End
- Begin Menu DispTools
- Caption = "&Display Tools"
- Checked = -1 'True
- Enabled = 0 'False
- End
- End
- Begin Menu Address
- Caption = "&Address"
- Begin Menu ShowAB
- Caption = "Show Address Book"
- End
- End
- Begin Menu Window
- Caption = "Window"
- WindowList = -1 'True
- Begin Menu wa
- Caption = "&Cascade"
- Index = 0
- End
- Begin Menu wa
- Caption = "Tile Horiz."
- Index = 1
- End
- Begin Menu wa
- Caption = "Tile Vert."
- Index = 2
- End
- Begin Menu wa
- Caption = "Arrange Icons"
- Index = 3
- End
- End
- Begin Menu HelpMenu
- Caption = "&Help"
- Begin Menu About
- Caption = "&About"
- End
- End
- Sub About_Click ()
- MsgBox "Sample Mail Application", 0, "VB Mail"
- End Sub
- Sub Delete_Click ()
- '--- Delete a mail message
- '---- In List view all selected messages are deleted
- If TypeOf VBMail.ActiveForm Is MsgView Then
- Call DeleteMessage
- ElseIf TypeOf VBMail.ActiveForm Is MailLst Then
- '----- Feature Addition: Added code to handle deleting multiple selection
- VBMail.MapiMess.MsgIndex = MailLst.MList.ListIndex
- Call DeleteMessage
- End If
- End Sub
- Sub DispTools_Click ()
- DispTools.Checked = Not DispTools.Checked
- MailLst.Tools.Visible = DispTools.Checked
- If MailLst.Tools.Visible Then
- Factor = 1
- ToolsSize% = -MailLst.Tools.Height
- Else
- Factor = -1
- ToolsSize% = 0
- End If
- Select Case MailLst.WindowState
- Case 0 'Grow or Shrink the form to reflect addition or deletion of Toolbar
- MailLst.Height = MailLst.Height + (Factor * MailLst.Tools.Height)
- Case 2 'If maximized, grow or shrink the listbox size
- MailLst.MList.Height = ScaleHeight - 90 - MailLst.MList.Top + ToolsSize%
- End Select
- End Sub
- Sub EditDelete_Click ()
- '--- Delete the items in the list
- On Error GoTo Trap
- If TypeOf VBMail.ActiveForm Is MailLst Then
- Call Delete_Click
- End If
- Exit Sub
- Trap:
- 'If an error occurs, there is probably no active form
- 'Leave the sub
- Exit Sub
- End Sub
- Sub Exit_Click ()
- '--- Close the app; make sure to logoff
- If MapiSess.SessionID <> 0 Then
- Call logoff_Click
- End If
- End
- End Sub
- Sub FontPrt_Click ()
- '---- Setup the printer fonts
- On Error Resume Next
- Cmdialog1.Flags = 2
- Cmdialog1.FontName = Printer.FontName
- Cmdialog1.FontSize = Printer.FontSize
- Cmdialog1.FontBold = Printer.FontBold
- Cmdialog1.FontItalic = Printer.FontItalic
- Cmdialog1.Action = 4
- If Err = 0 Then
- Printer.FontName = Cmdialog1.FontName
- Printer.FontSize = Cmdialog1.FontSize
- Printer.FontBold = Cmdialog1.FontBold
- Printer.FontItalic = Cmdialog1.FontItalic
- End If
- End Sub
- Sub FontScreen_Click ()
- '---- Setup the screen fonts for the current control
- On Error Resume Next
- Cmdialog1.Flags = 1
- Cmdialog1.FontName = VBMail.ActiveForm.ActiveControl.FontName
- Cmdialog1.FontSize = VBMail.ActiveForm.ActiveControl.FontSize
- Cmdialog1.FontBold = VBMail.ActiveForm.ActiveControl.FontBold
- Cmdialog1.FontItalic = VBMail.ActiveForm.ActiveControl.FontItalic
- Cmdialog1.Action = 4
- If Err = 0 Then
- VBMail.ActiveForm.ActiveControl.FontName = Cmdialog1.FontName
- VBMail.ActiveForm.ActiveControl.FontSize = Cmdialog1.FontSize
- VBMail.ActiveForm.ActiveControl.FontBold = Cmdialog1.FontBold
- VBMail.ActiveForm.ActiveControl.FontItalic = Cmdialog1.FontItalic
- End If
- End Sub
- Sub logoff_Click ()
- '----- LogOf
- Call LogOffUser
- End Sub
- Sub Logon_Click ()
- '----- Logon to the mail system
- On Error Resume Next
- MapiSess.Action = 1
- If Err <> 0 Then
- MsgBox "Logon Failure: " + Error$
- Else
- Screen.MousePointer = 11
- MapiMess.SessionID = MapiSess.SessionID
- '------ Get the message count
- GetMessageCount
- '------ Load the mail list w/ envelope information
- Screen.MousePointer = 11
- Call LoadList(MapiMess)
- Screen.MousePointer = 0
- '------ Adjust the buttons as needed
- Logon.Enabled = False
- Logoff.Enabled = True
- VBMail.SendCtl(MESSAGE_COMPOSE).Enabled = True
- VBMail.SendCtl(MESSAGE_ReplyAll).Enabled = True
- VBMail.SendCtl(MESSAGE_Reply).Enabled = True
- VBMail.SendCtl(Message_Forward).Enabled = True
- VBMail.PrintMessage.Enabled = True
- VBMail.DispTools.Enabled = True
- VBMail.rMsgList.Enabled = True
- VBMail.EditDelete.Enabled = True
- End If
- End Sub
- Sub MailOpts_Click ()
- '----- Display the Mail Options form
- OptionType = OPTION_GENERAL
- MailOptFrm.Show 1
- End Sub
- Sub MDIForm_Load ()
- '---- Ensure all the controls are sized as needed
- TimeLbl = Time$
- SendWithMapi = True
- Call Picture1_Resize
- Call Picture2_Resize
- VBMail.MsgCountLbl = "Off Line"
- End Sub
- Sub Next_Click ()
- '---- View the next message in the list
- If MailLst.MList.ListIndex <> MailLst.MList.ListCount - 1 Then
- MailLst.MList.ItemData(MailLst.MList.ListIndex) = False
- MailLst.MList.ListIndex = MailLst.MList.ListIndex + 1
- End If
- Call ViewNextMsg
- End Sub
- Sub Picture1_Resize ()
- Const TimeBoxStartOffset = 1200
- Const TimeBoxEndOffset = 60
- Const MsgBoxStartOffset = 60
- Const MsgBoxEndOffset = TimeBoxStartOffset + 90
- '---- Adjust the sizes of the lines and position the time label
- TimeLbl.Left = Picture1.Width - TimeLbl.Width - 265
- TopLine2(0).X2 = Picture1.Width
- TopLine2(1).X2 = Picture1.Width
- TimeBoxLine(0).X1 = Picture1.Width - TimeBoxStartOffset
- TimeBoxLine(0).X2 = Picture1.Width - TimeBoxEndOffset
- TimeBoxLine(1).X1 = Picture1.Width - TimeBoxStartOffset
- TimeBoxLine(1).X2 = Picture1.Width - TimeBoxEndOffset
- TimeBoxSide(0).X1 = Picture1.Width - TimeBoxStartOffset
- TimeBoxSide(0).X2 = Picture1.Width - TimeBoxStartOffset
- TimeBoxSide(1).X1 = Picture1.Width - TimeBoxEndOffset
- TimeBoxSide(1).X2 = Picture1.Width - TimeBoxEndOffset
- MsgBoxLine(0).X2 = Picture1.Width - MsgBoxEndOffset
- MsgBoxLine(1).X2 = Picture1.Width - MsgBoxEndOffset
- MsgBoxSide(1).X1 = Picture1.Width - MsgBoxEndOffset
- MsgBoxSide(1).X2 = Picture1.Width - MsgBoxEndOffset
- Picture1.Refresh
- End Sub
- Sub Picture2_Resize ()
- 'Adjust the positions of the lines
- TopLine(0).X2 = Picture2.Width
- TopLine(1).X2 = Picture2.Width
- Picture2.Refresh
- End Sub
- Sub Previous_Click ()
- '---- View the Previous message in the list
- If MailLst.MList.ListIndex <> 0 Then
- MailLst.MList.ItemData(MailLst.MList.ListIndex) = False
- MailLst.MList.ListIndex = MailLst.MList.ListIndex - 1
- End If
- Call ViewNextMsg
- End Sub
- Sub PrintMessage_Click ()
- '---- Print Mail
- Call PrintMail
- End Sub
- Sub PrSetup_Click ()
- '----- Call the printer setup routine in the cmdialog control
- On Error Resume Next
- Cmdialog1.Flags = &H40 'Printer Setup dialog only
- Cmdialog1.Action = 5
- End Sub
- Sub rMsgList_Click ()
- Screen.MousePointer = 11
- GetMessageCount
- Call LoadList(MapiMess)
- Screen.MousePointer = 0
- End Sub
- Sub SendCtl_Click (Index As Integer)
- Dim NewMessage As New NewMsg
- On Error Resume Next
- 'Index = 6: Compose New Message
- ' = 7: Reply
- ' = 8: Reply All
- ' = 9: Forward
- 'Save header information and current note text
- If Index > 6 Then
- 'SVNote = GetHeader(VBMAIL.MapiMess) + VBMAIL.MapiMess.MsgNoteText
- SVNote = VBMail.MapiMess.MsgNoteText
- SVNote = GetHeader(VBMail.MapiMess) + SVNote
- End If
- VBMail.MapiMess.Action = Index
- 'Set the new message text
- If Index > 6 Then
- VBMail.MapiMess.MsgNoteText = SVNote
- End If
- If SendWithMapi Then
- VBMail.MapiMess.Action = MESSAGE_SENDDLG 'MAPI Send with Dialog
- Else
- Call LoadMessage(-1, NewMessage) 'Load Message into VBMail NewMSG Window
- End If
- End Sub
- Sub ShowAB_Click ()
- On Error Resume Next
- '--------------------------------------------------------------
- ' Show Address for current message
- '--------------------------------------------------------------
- VBMail.MapiMess.Action = MESSAGE_SHOWADBOOK
- If Err Then
- If Err <> 32001 Then 'User hit cancel
- MsgBox "Error: " + Error$ + " occured trying to show the Address Book"
- End If
- Else
- If TypeOf VBMail.ActiveForm Is NewMsg Then
- Call UpdateRecips(VBMail.ActiveForm)
- End If
- End If
- End Sub
- Sub Timer1_Timer ()
- '----- Update the time label
- TimeLbl = Time$
- End Sub
- Sub wa_Click (Index As Integer)
- '----- Arrange the windows as selected
- VBMail.Arrange Index
- End Sub
-