<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: mailto button in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061606#M53080</link>
    <description>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 &amp;amp; Engineers
brand@centry.net

"Max" &lt;SMOOTHER&gt; wrote in message
news:40d2087c$1_3@newsprd01...
&amp;gt; Hi
&amp;gt;
&amp;gt; I would like my button when selected to open Outlook and put a email
address
&amp;gt; in, similiar to 'mailto' in HTML
&amp;gt;
&amp;gt; Thanks for the help
&amp;gt;
&amp;gt; Max
&amp;gt;
&amp;gt;&lt;/SMOOTHER&gt;</description>
    <pubDate>Thu, 17 Jun 2004 22:45:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-06-17T22:45:57Z</dc:date>
    <item>
      <title>mailto button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061605#M53079</link>
      <description>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</description>
      <pubDate>Thu, 17 Jun 2004 21:09:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061605#M53079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-17T21:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: mailto button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061606#M53080</link>
      <description>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 &amp;amp; Engineers
brand@centry.net

"Max" &lt;SMOOTHER&gt; wrote in message
news:40d2087c$1_3@newsprd01...
&amp;gt; Hi
&amp;gt;
&amp;gt; I would like my button when selected to open Outlook and put a email
address
&amp;gt; in, similiar to 'mailto' in HTML
&amp;gt;
&amp;gt; Thanks for the help
&amp;gt;
&amp;gt; Max
&amp;gt;
&amp;gt;&lt;/SMOOTHER&gt;</description>
      <pubDate>Thu, 17 Jun 2004 22:45:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061606#M53080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-17T22:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: mailto button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061607#M53081</link>
      <description>Try this - late bind so you don't need to worry about a reference!

 Public Sub CreateMessage(sTo As String, sSubject As String, sMessage As
 String, Optional bSend As Boolean)
 Dim oOL As Object
 Dim oEmail As Object
 
 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

-- Mike
___________________________
Mike Tuersley
CADalyst's CAD Clinic
Rand IMAGINiT Technologies
___________________________
the trick is to realize that there is no spoon...</description>
      <pubDate>Fri, 18 Jun 2004 04:33:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/mailto-button/m-p/1061607#M53081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-18T04:33:08Z</dc:date>
    </item>
  </channel>
</rss>

