home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form MailForm
- BorderStyle = 3 'Fixed Dialog
- Caption = "AK-Mail OLE Sample"
- ClientHeight = 5415
- ClientLeft = 1575
- ClientTop = 1575
- ClientWidth = 6690
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 5415
- ScaleWidth = 6690
- ShowInTaskbar = 0 'False
- Begin VB.CommandButton DoSend
- Caption = "Send"
- Height = 375
- Left = 120
- TabIndex = 6
- Top = 4920
- Width = 6375
- End
- Begin VB.TextBox MailText
- Height = 3855
- Left = 840
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 5
- Top = 840
- Width = 5655
- End
- Begin VB.TextBox Subject
- Height = 285
- Left = 840
- TabIndex = 3
- Top = 480
- Width = 5655
- End
- Begin VB.TextBox ToField
- Height = 285
- Left = 840
- TabIndex = 1
- Top = 120
- Width = 5655
- End
- Begin VB.Label Label2
- Caption = "Text:"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 840
- Width = 615
- End
- Begin VB.Label Label3
- Caption = "Subject:"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 480
- Width = 615
- End
- Begin VB.Label Label1
- Caption = "To:"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 615
- End
- Attribute VB_Name = "MailForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim o As Object
- Private Sub DoSend_Click()
- Dim retval As Long
- o.ToField = ToField.Text
- o.CcField = ""
- o.BccField = ""
- o.Subject = Subject.Text
- o.Body = MailText.Text
- ' Replace account name by your own account name
- retval = o.StoreNewMail("Standard-Konto")
- MsgBox "StoreNewMail returned " + Str$(retval)
- End Sub
- Private Sub Form_Load()
- On Error GoTo ErrorManagement
- ' Check, if AK-Mail is running
- Set o = GetObject(, "akmail.application")
- GoTo skip
- ErrorManagement:
- ' Error 429 indicated that AK-Mail is not
- ' running. That means there is no AK-Mail
- ' object.
- ' CreateObject then creates a new one
- If Err.Number = 429 Then
- Set o = CreateObject("akmail.application")
- End If
- skip:
- ' other code
- End Sub
-