⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 这里有很多很实用的VB编程案例,方便大家学习VB.
💻 FRM
字号:
VERSION 5.00
Object = "{20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0"; "MSMAPI32.OCX"
Begin VB.Form Form1 
   Caption         =   "邮件发送"
   ClientHeight    =   4155
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4755
   LinkTopic       =   "Form1"
   ScaleHeight     =   4155
   ScaleWidth      =   4755
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   1560
      TabIndex        =   8
      Text            =   "zmhh@263.net"
      Top             =   120
      Width           =   2295
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   960
      TabIndex        =   3
      Text            =   "Text3"
      Top             =   2760
      Width           =   3375
   End
   Begin VB.TextBox Text2 
      Height          =   1215
      Left            =   840
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   2
      Text            =   "Form1.frx":0000
      Top             =   1320
      Width           =   3495
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1560
      TabIndex        =   1
      Text            =   "《VB控件编程百例》"
      Top             =   720
      Width           =   2775
   End
   Begin VB.CommandButton Command1 
      Caption         =   "发送"
      Height          =   375
      Left            =   1320
      TabIndex        =   0
      Top             =   3360
      Width           =   1935
   End
   Begin MSMAPI.MAPIMessages MAPIMessages1 
      Left            =   3600
      Top             =   3360
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      AddressEditFieldCount=   1
      AddressModifiable=   0   'False
      AddressResolveUI=   0   'False
      FetchSorted     =   0   'False
      FetchUnreadOnly =   0   'False
   End
   Begin MSMAPI.MAPISession MAPISession1 
      Left            =   360
      Top             =   3360
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DownloadMail    =   -1  'True
      LogonUI         =   -1  'True
      NewSession      =   0   'False
   End
   Begin VB.Label Label4 
      Caption         =   "对方邮箱地址"
      Height          =   180
      Left            =   240
      TabIndex        =   7
      Top             =   120
      Width           =   1080
   End
   Begin VB.Label Label3 
      Caption         =   "附件"
      Height          =   180
      Left            =   360
      TabIndex        =   6
      Top             =   2760
      Width           =   360
   End
   Begin VB.Label Label2 
      Caption         =   "内容"
      Height          =   615
      Left            =   480
      TabIndex        =   5
      Top             =   1320
      Width           =   255
   End
   Begin VB.Label Label1 
      Caption         =   "主题"
      Height          =   180
      Left            =   960
      TabIndex        =   4
      Top             =   720
      Width           =   360
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    MAPISession1.SignOn
    MAPIMessages1.SessionID = MAPISession1.SessionID
    MAPIMessages1.Compose '创建一封新的消息
    MAPIMessages1.RecipAddress = Text4.Text
    MAPIMessages1.AddressResolveUI = True
    MAPIMessages1.ResolveName
    MAPIMessages1.MsgSubject = Trim(Text1.Text)   '邮件主题
    MAPIMessages1.MsgNoteText = Trim(Text2.Text)  '邮件内容
    MAPIMessages1.AttachmentPathName = Text3.Text '邮件附件
    MAPIMessages1.Send
    MAPISession1.SignOff
    MsgBox "邮件发送完毕"
End Sub

Private Sub Form_Load()
    Text3.Text = App.Path + "\zmhh.txt"
End Sub

Private Sub Text3_LostFocus()
    If Dir(Text3.Text) = "" Then
        MsgBox "不存在这个文件"
        Text3.SetFocus
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -