home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / newmsg.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  8.7 KB  |  275 lines

  1. VERSION 4.00
  2. Begin VB.Form NewMsg 
  3.    Caption         =   "Send Note"
  4.    ClientHeight    =   3135
  5.    ClientLeft      =   1875
  6.    ClientTop       =   2160
  7.    ClientWidth     =   7380
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   1
  11.       weight          =   400
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    Height          =   3540
  18.    Left            =   1815
  19.    LinkTopic       =   "Form2"
  20.    MDIChild        =   -1  'True
  21.    ScaleHeight     =   3135
  22.    ScaleWidth      =   7380
  23.    Top             =   1815
  24.    Width           =   7500
  25.    Begin VB.PictureBox Picture2 
  26.       Align           =   1  'Align Top
  27.       BackColor       =   &H00C0C0C0&
  28.       BorderStyle     =   0  'None
  29.       Height          =   495
  30.       Left            =   0
  31.       ScaleHeight     =   495
  32.       ScaleWidth      =   7380
  33.       TabIndex        =   8
  34.       Top             =   0
  35.       Width           =   7380
  36.       Begin VB.CommandButton CompAdd 
  37.          Caption         =   "A&ddress"
  38.          Height          =   330
  39.          Left            =   5940
  40.          TabIndex        =   13
  41.          Top             =   90
  42.          Width           =   1335
  43.       End
  44.       Begin VB.CommandButton CompOpt 
  45.          Caption         =   "Op&tions"
  46.          Height          =   330
  47.          Left            =   4500
  48.          TabIndex        =   12
  49.          Top             =   90
  50.          Width           =   1335
  51.       End
  52.       Begin VB.CommandButton Attach 
  53.          Caption         =   "&Attach"
  54.          Height          =   330
  55.          Left            =   3060
  56.          TabIndex        =   11
  57.          Top             =   90
  58.          Width           =   1335
  59.       End
  60.       Begin VB.CommandButton ChkNames 
  61.          Caption         =   "Chec&k Names"
  62.          Height          =   330
  63.          Left            =   1620
  64.          TabIndex        =   10
  65.          Top             =   90
  66.          Width           =   1335
  67.       End
  68.       Begin VB.CommandButton Send 
  69.          Caption         =   "&Send"
  70.          Height          =   330
  71.          Left            =   180
  72.          TabIndex        =   9
  73.          Top             =   90
  74.          Width           =   1335
  75.       End
  76.       Begin VB.Line Line2 
  77.          BorderColor     =   &H00FFFFFF&
  78.          X1              =   0
  79.          X2              =   0
  80.          Y1              =   0
  81.          Y2              =   540
  82.       End
  83.       Begin VB.Line TopLine2 
  84.          BorderColor     =   &H00FFFFFF&
  85.          X1              =   0
  86.          X2              =   7380
  87.          Y1              =   0
  88.          Y2              =   0
  89.       End
  90.    End
  91.    Begin VB.TextBox txtNoteText 
  92.       Height          =   1275
  93.       Left            =   0
  94.       MultiLine       =   -1  'True
  95.       ScrollBars      =   2  'Vertical
  96.       TabIndex        =   3
  97.       Top             =   1890
  98.       Width           =   7395
  99.    End
  100.    Begin VB.PictureBox Picture1 
  101.       Align           =   1  'Align Top
  102.       BackColor       =   &H00C0C0C0&
  103.       BorderStyle     =   0  'None
  104.       FillStyle       =   0  'Solid
  105.       Height          =   1395
  106.       Left            =   0
  107.       ScaleHeight     =   1395
  108.       ScaleWidth      =   7380
  109.       TabIndex        =   4
  110.       Top             =   495
  111.       Width           =   7380
  112.       Begin VB.TextBox txtTo 
  113.          BackColor       =   &H00FFFFFF&
  114.          Height          =   285
  115.          Left            =   900
  116.          TabIndex        =   0
  117.          Top             =   180
  118.          Width           =   4995
  119.       End
  120.       Begin VB.TextBox txtcc 
  121.          BackColor       =   &H00FFFFFF&
  122.          Height          =   285
  123.          Left            =   900
  124.          TabIndex        =   1
  125.          Top             =   540
  126.          Width           =   4995
  127.       End
  128.       Begin VB.TextBox txtsubject 
  129.          BackColor       =   &H00FFFFFF&
  130.          Height          =   285
  131.          Left            =   900
  132.          TabIndex        =   2
  133.          Top             =   900
  134.          Width           =   4995
  135.       End
  136.       Begin VB.Line TopLine 
  137.          BorderColor     =   &H00FFFFFF&
  138.          Index           =   1
  139.          X1              =   0
  140.          X2              =   7320
  141.          Y1              =   15
  142.          Y2              =   15
  143.       End
  144.       Begin VB.Line LeftLine 
  145.          BorderColor     =   &H00FFFFFF&
  146.          X1              =   0
  147.          X2              =   0
  148.          Y1              =   0
  149.          Y2              =   1380
  150.       End
  151.       Begin VB.Line TopLine 
  152.          BorderColor     =   &H00000000&
  153.          Index           =   0
  154.          X1              =   0
  155.          X2              =   7320
  156.          Y1              =   0
  157.          Y2              =   0
  158.       End
  159.       Begin VB.Label Label3 
  160.          AutoSize        =   -1  'True
  161.          BackStyle       =   0  'Transparent
  162.          Caption         =   "&To:"
  163.          Height          =   195
  164.          Left            =   120
  165.          TabIndex        =   5
  166.          Top             =   240
  167.          Width           =   300
  168.       End
  169.       Begin VB.Label Label4 
  170.          AutoSize        =   -1  'True
  171.          BackStyle       =   0  'Transparent
  172.          Caption         =   "&Cc:"
  173.          Height          =   195
  174.          Left            =   120
  175.          TabIndex        =   6
  176.          Top             =   600
  177.          Width           =   300
  178.       End
  179.       Begin VB.Label Label5 
  180.          AutoSize        =   -1  'True
  181.          BackStyle       =   0  'Transparent
  182.          Caption         =   "Subj&ect:"
  183.          Height          =   195
  184.          Left            =   120
  185.          TabIndex        =   7
  186.          Top             =   960
  187.          Width           =   720
  188.       End
  189.    End
  190. Attribute VB_Name = "NewMsg"
  191. Attribute VB_Creatable = False
  192. Attribute VB_Exposed = False
  193. Private Sub Attach_Click()
  194. ' Handle attachments.
  195. On Error Resume Next
  196.    VBMail.CMDialog1.DialogTitle = "Attach"
  197.    VBMail.CMDialog1.Filter = "All Files(*.*)|*.*|Text Files(*.txt)|*.txt"
  198.    VBMail.CMDialog1.ShowOpen
  199.    If Err = 0 Then
  200.         On Error GoTo 0
  201.         VBMail.MapiMess.AttachmentIndex = VBMail.MapiMess.AttachmentCount
  202.         VBMail.MapiMess.AttachmentName = VBMail.CMDialog1.FileTitle
  203.         VBMail.MapiMess.AttachmentPathName = VBMail.CMDialog1.FileName
  204.         VBMail.MapiMess.AttachmentPosition = VBMail.MapiMess.AttachmentIndex
  205.         VBMail.MapiMess.AttachmentType = vbAttachTypeData
  206.    End If
  207. End Sub
  208. Private Sub ChkNames_Click()
  209.     ' Resolve the names.
  210.     Call CopyNamestoMsgBuffer(Me, True)
  211.     Call UpdateRecips(Me)
  212. End Sub
  213. Private Sub CompAdd_Click()
  214.     ' Display the address book and update upon return.
  215.     Call CopyNamestoMsgBuffer(Me, False)
  216.     VBMail.MapiMess.Action = vbMessageShowAdBook
  217.     Call UpdateRecips(Me)
  218. End Sub
  219. Private Sub CompOpt_Click()
  220.     ' Display the Message Option form.
  221.     OptionType = conOptionMessage
  222.     MailOptFrm.Show 1
  223. End Sub
  224. Private Sub Form_Activate()
  225.     ' Set the MessageIndex to -1 (Compose Buffer) when this window is activated.
  226.     VBMail.MapiMess.MsgIndex = -1
  227. End Sub
  228. Private Sub Form_Load()
  229.     ' Ensure the windows are sized as needed.
  230.     Call Picture1_Resize
  231.     Call Picture2_Resize
  232.     Call Form_Resize
  233. End Sub
  234. Private Sub Form_Resize()
  235.     ' Adjust the window sizes if the form isn't minimized.
  236.     If WindowState <> 1 Then
  237.         If ScaleHeight > txtNoteText.Top Then
  238.             txtNoteText.Height = ScaleHeight - txtNoteText.Top
  239.             txtNoteText.Width = ScaleWidth
  240.         End If
  241.     End If
  242. End Sub
  243. Private Sub Picture1_Resize()
  244.     ' Update the widths of the fields and adjust the line
  245.     ' controls as needed.
  246.     TopLine(0).X2 = picture1.Width
  247.     TopLine(1).X2 = picture1.Width
  248.     picture1.Refresh
  249. End Sub
  250. Private Sub Picture2_Resize()
  251.     ' Update the widths of the fields and adjust the line
  252.     ' controls as needed.
  253.     TopLine2.X2 = Picture2.Width
  254.     Picture2.Refresh
  255. End Sub
  256. Private Sub Send_Click()
  257.     ' Place the Subject and Note text into the buffer.
  258.     ' Add room in the beginning for attachment files.
  259.     If VBMail.MapiMess.AttachmentCount > 0 Then
  260.         txtNoteText = String$(VBMail.MapiMess.AttachmentCount, "*") + txtNoteText
  261.     End If
  262.     VBMail.MapiMess.MsgSubject = txtSubject
  263.     VBMail.MapiMess.MsgNoteText = txtNoteText
  264.     VBMail.MapiMess.MsgReceiptRequested = ReturnRequest
  265.     Call CopyNamestoMsgBuffer(Me, True)
  266.                   
  267.     On Error Resume Next
  268.     VBMail.MapiMess.Action = vbMessageSend
  269.     If Err Then
  270.         MsgBox "An error occurred during a send: " + Str$(Err)
  271.     Else
  272.         Unload Me
  273.     End If
  274. End Sub
  275.