Max,
I just wrote the following for one of my apps.
Public Sub CreateMessage(sTo As String, sSubject As String, sMessage As
String, Optional bSend As Boolean)
Dim oOL As Outlook.Application
Dim oEmail As Outlook.MailItem
On Error Resume Next
Set oOL = GetObject(, "Outlook.Application")
If oOL Is Nothing Then
Set oOL = CreateObject("Outlook.Application")
If oOL Is Nothing Then
MsgBox "Could not start Outlook. Please start Outlook and try
again."
GoSub Cleanup
End If
End If
Set oEmail = oOL.CreateItem(olMailItem)
With oEmail
.To = sTo
.Subject = sSubject
.Body = sMessage
.Display
If bSend = True Then .sEnd
End With
Cleanup:
Set oOL = Nothing
Set oEmail = Nothing
End Sub
You need to add a reference to the Microsoft Outlook X.x (your version)
Object Library to your project. This was just a first run, but it did
exactly what I wanted it to do. To hook it up to a button, you'd need to use
something like:
^c^c(vl-vbarun "c:/path/myproject.dvb!CreateMessage");
Ben Rand
CAD Manager
CEntry Constructors & Engineers
brand@centry.net
"Max" wrote in message
news:40d2087c$1_3@newsprd01...
> Hi
>
> I would like my button when selected to open Outlook and put a email
address
> in, similiar to 'mailto' in HTML
>
> Thanks for the help
>
> Max
>
>