Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Opening Oulook Express From Visual Basic

Posted on 2001-06-13
4
Medium Priority
?
214 Views
Last Modified: 2013-11-25
How do i open up an Outlook express from VB to send a Mail?
0
Comment
Question by:kannanonline
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

Expert Comment

by:roverm
ID: 6186917
This should do the trick:

Private Sub Command1_Click()
Dim objOutlook As Object
Dim objMail As Object

    Set objOutlook = CreateObject("Outlook.Application")
    Set objMail = objOutlook.CreateItem(0)
       
    With objMail
        .To = "bill.gates@microsoft.com"
        .Subject = "MyTestMail"
        .Body = "This is the text."
        .Send
    End With
   
    Set objMail = Nothing
    Set objOutlook = Nothing
   
End Sub

D'Mzzl!
RoverM
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 200 total points
ID: 6186945
That won't work because Outlook Express does not expose a useful object hierarchy like Outlook.  Here is an example that shows how to send mail using the MAPI controls that come with VB.  This will work with outlook express which is a simple mapi client (this is the only way to automate Outlook Express.)

HOWTO: How to Send/Receive E-Mail Messages with Visual Basic

http://support.microsoft.com/support/kb/articles/Q185/1/71.ASP
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136044
Hi kannanonline,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept PaulHews's comment(s) as an answer.

kannanonline, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7168452
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question