home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 October / PCWorld_2004-10_cd.bin / software / vyzkuste / spyware / spyware.exe / akme32.exe / OleAutomation / MailForm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-11-27  |  2.9 KB  |  104 lines

  1. VERSION 5.00
  2. Begin VB.Form MailForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "AK-Mail OLE Sample"
  5.    ClientHeight    =   5415
  6.    ClientLeft      =   1575
  7.    ClientTop       =   1575
  8.    ClientWidth     =   6690
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   5415
  14.    ScaleWidth      =   6690
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.CommandButton DoSend 
  17.       Caption         =   "Send"
  18.       Height          =   375
  19.       Left            =   120
  20.       TabIndex        =   6
  21.       Top             =   4920
  22.       Width           =   6375
  23.    End
  24.    Begin VB.TextBox MailText 
  25.       Height          =   3855
  26.       Left            =   840
  27.       MultiLine       =   -1  'True
  28.       ScrollBars      =   3  'Both
  29.       TabIndex        =   5
  30.       Top             =   840
  31.       Width           =   5655
  32.    End
  33.    Begin VB.TextBox Subject 
  34.       Height          =   285
  35.       Left            =   840
  36.       TabIndex        =   3
  37.       Top             =   480
  38.       Width           =   5655
  39.    End
  40.    Begin VB.TextBox ToField 
  41.       Height          =   285
  42.       Left            =   840
  43.       TabIndex        =   1
  44.       Top             =   120
  45.       Width           =   5655
  46.    End
  47.    Begin VB.Label Label2 
  48.       Caption         =   "Text:"
  49.       Height          =   255
  50.       Left            =   120
  51.       TabIndex        =   4
  52.       Top             =   840
  53.       Width           =   615
  54.    End
  55.    Begin VB.Label Label3 
  56.       Caption         =   "Subject:"
  57.       Height          =   255
  58.       Left            =   120
  59.       TabIndex        =   2
  60.       Top             =   480
  61.       Width           =   615
  62.    End
  63.    Begin VB.Label Label1 
  64.       Caption         =   "To:"
  65.       Height          =   255
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Top             =   120
  69.       Width           =   615
  70.    End
  71. Attribute VB_Name = "MailForm"
  72. Attribute VB_GlobalNameSpace = False
  73. Attribute VB_Creatable = False
  74. Attribute VB_PredeclaredId = True
  75. Attribute VB_Exposed = False
  76. Dim o As Object
  77. Private Sub DoSend_Click()
  78.   Dim retval As Long
  79.   o.ToField = ToField.Text
  80.   o.CcField = ""
  81.   o.BccField = ""
  82.   o.Subject = Subject.Text
  83.   o.Body = MailText.Text
  84.   ' Replace account name by your own account name
  85.   retval = o.StoreNewMail("Standard-Konto")
  86.   MsgBox "StoreNewMail returned " + Str$(retval)
  87. End Sub
  88. Private Sub Form_Load()
  89.   On Error GoTo ErrorManagement
  90.   ' Check, if AK-Mail is running
  91.   Set o = GetObject(, "akmail.application")
  92.   GoTo skip
  93. ErrorManagement:
  94.   ' Error 429 indicated that AK-Mail is not
  95.   ' running. That means there is no AK-Mail
  96.   ' object.
  97.   ' CreateObject then creates a new one
  98.   If Err.Number = 429 Then
  99.     Set o = CreateObject("akmail.application")
  100.   End If
  101. skip:
  102.   ' other code
  103. End Sub
  104.