Solved

Opening Oulook Express From Visual Basic

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WPF issue with Trigger 2 96
Best way to parse out a json string in VB6? 10 116
Using "ScreenUpdating" 6 55
VB6 - Compare and highlight cell not the same 3 44
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now