Solved

Opening Oulook Express From Visual Basic

Posted on 2001-06-13
4
198 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
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 50 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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