home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form MailBox
- BackColor = &H00FFFF00&
- Caption = "Mailbox"
- ClientHeight = 4650
- ClientLeft = 1065
- ClientTop = 1530
- ClientWidth = 7305
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 5340
- Icon = MAILBOX.FRX:0000
- Left = 1005
- LinkMode = 1 'Source
- LinkTopic = "Form2"
- MaxButton = 0 'False
- ScaleHeight = 4650
- ScaleWidth = 7305
- Top = 900
- Width = 7425
- Begin TextBox MsgText
- BackColor = &H00FFFF00&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 2295
- Left = 360
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 2
- Top = 2070
- Width = 6645
- End
- Begin ListBox MailList
- BackColor = &H00FFFFFF&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "System"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1230
- Left = 360
- Sorted = -1 'True
- TabIndex = 0
- Top = 450
- Width = 6645
- End
- Begin Label Label3
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- Caption = "Date From Subject"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 360
- TabIndex = 1
- Top = 210
- Width = 6645
- End
- Begin Menu ID_FILE
- Caption = "&File"
- Begin Menu ID_OPEN
- Caption = "&Open..."
- Begin Menu ID_EDITOR
- Caption = "&Editor"
- End
- Begin Menu ID_MAILBOX
- Caption = "&Mailbox"
- End
- Begin Menu ID_MAILFILES
- Caption = "Mail &Files"
- End
- End
- Begin Menu ID_REPLY
- Caption = "&Reply"
- End
- Begin Menu ID_SAVE
- Caption = "&Save"
- End
- Begin Menu sep1
- Caption = "-"
- End
- Begin Menu ID_DELETE
- Caption = "&Delete"
- End
- Begin Menu sep
- Caption = "-"
- End
- Begin Menu ID_EXIT
- Caption = "E&xit"
- End
- End
- Begin Menu ID_EDIT
- Caption = "&Edit"
- Begin Menu ID_COPY
- Caption = "&Copy Ctrl+Ins"
- End
- End
- DefInt A-Z
- ' ---- Delete a Message from the MailList Listbox
- Sub DeleteMessage ()
- MailList.RemoveItem MailList.ListIndex
- If MailList.ListCount = 0 Then
- MsgText.Text = ""
- If Extension = "MSG" Then
- MailPending = False
- SetMailBoxIcon
- End If
- Else
- If MailList.ListIndex = -1 Then
- MailList.ListIndex = 0
- End If
- End If
- FixMenu
- End Sub
- ' ---- Load Messages into the MailBox Whenever it is Loaded
- Sub Form_Load ()
- RebuildMailBox
- End Sub
- ' ---- Called by VB to Paint the Form
- Sub Form_Paint ()
- If Extension = "" Then
- Extension = "MSG"
- RebuildMailBox
- End If
- End Sub
- ' ---- Exit from VBMAIL (if permitted)
- Sub Form_Unload (Cancel As Integer)
- If CanExit = True Then
- End
- End If
- Extension = ""
- End Sub
- ' ---- Edit/Copy Menu Command
- Sub ID_COPY_Click ()
- SendKeys "^{INSERT}"
- End Sub
- ' ---- File/Delete Menu Command
- Sub ID_DELETE_Click ()
- If MsgBox("Delete the selected message?", MB_YESNO) = IDYES Then
- Kill MsgFile()
- DeleteMessage
- End If
- End Sub
- ' ---- Edit Menubar Selection
- Sub ID_EDIT_Click ()
- ID_COPY.Enabled = (MsgText.SelLength > 0)
- End Sub
- ' ---- File/Open/Editor Menu Command
- Sub ID_EDITOR_Click ()
- If Extension = "FIL" Then
- LoadMailBox "MSG"
- End If
- Mailbox.WindowState = MINIMIZED
- Editor.Show
- Editor.WindowState = NORMAL
- End Sub
- ' ---- File/Exit Menu Command
- Sub ID_EXIT_Click ()
- CanExit = True
- Unload Mailbox
- End Sub
- ' ---- File/Open/Mailbox Menu Command
- Sub ID_MAILBOX_Click ()
- LoadMailBox "MSG"
- End Sub
- ' ---- File/Open/Mail Files Menu Command
- Sub ID_MAILFILES_Click ()
- LoadMailBox "FIL"
- End Sub
- ' ---- File/Reply Menu Command
- Sub ID_REPLY_Click ()
- Reply.MsgDate.Caption = MsgDate
- Reply.MsgFrom.Caption = MsgFrom
- Reply.MsgSubj.Caption = MsgSubject
- Reply.MsgText.Text = Mailbox.MsgText.Text
- SetMailBoxIcon
- Mailbox.WindowState = MINIMIZED
- Reply.Show
- Reply.ReplyText.SetFocus
- End Sub
- ' ---- File/Save Menu Command
- Sub ID_SAVE_Click ()
- fn$ = MsgFile()
- If Extension = "FIL" Then
- Ext$ = "MSG"
- Else
- Ext$ = "FIL"
- End If
- Name fn$ As Left$(fn$, Len(fn$) - 3) + Ext$
- DeleteMessage
- End Sub
- ' ---- Select an Entry in the MailList Listbox
- Sub MailList_Click ()
- ' ---- Extract the data items
- fn$ = Mid$(MailList.List(MailList.ListIndex), 56)
- MsgFrom = Mid$(MailList.List(MailList.ListIndex), 10, 15)
- MsgDate = Left$(MailList.List(MailList.ListIndex), 8)
- Open MyUserId + "\" + fn$ For Input Access Read As #1
- Input #1, dt$, fr$, MsgSubject, tx$
- ' ---- Convert text tokens to quotes
- ConvertChar tx$, Chr$(127), Chr$(34)
- ' ----Build the message into the message form
- Mailbox.MsgText.Text = tx$
- Close #1
- End Sub
- ' ---- Intercept the Del Key on the MailList Listbox
- Sub MailList_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DELETE And MailList.ListCount <> 0 Then
- ID_DELETE_Click
- End If
- End Sub
- ' --- Extract the Message Filename from the current
- ' MailList Listbox Entry
- Function MsgFile () As String
- MsgFile = MyUserId + "\" + Mid$(MailList.List(MailList.ListIndex), 56)
- End Function
- ' ---- MsgText Text Box is Read-only. Prevent Cut, Paste, Delete
- Sub MsgText_KeyDown (KeyCode As Integer, Shift As Integer)
- NoClipBrd KeyCode, Shift
- End Sub
- ' ---- MsgText Textbox is Read-Only. Intercept Keystrokes
- Sub MsgText_KeyPress (KeyAscii As Integer)
- KeyAscii = 0
- End Sub
- ' ---- Clear and Load the MailBox Form with Messages
- ' ---- Extension = "MSG" or "FIL"
- Sub RebuildMailBox ()
- ' ----Clear any existing messages
- Do While i < MailList.ListCount
- MailList.RemoveItem i
- i = i + 1
- Loop
- ' ----Gather messages
- fpath$ = MyUserId + "\*." + Extension
- fn$ = Dir$(fpath$)
- Do While fn$ <> ""
- AddMessage fn$
- fn$ = Dir$
- Loop
- If MailList.ListCount <> 0 Then
- MailList.ListIndex = 0
- End If
- FixMenu
- End Sub
-