Display mail application either in Outlook, or Outlook express

H

hotbero

Hi!

From VBA, no matter if I am using Outlook, or Outlook Express (must
work in both)


I would like to display the mail application, "not sending anything",
just display.

something like, from Ron de Bruin:
Dim OutApp As Outlook.Application ' but what happen with Outlook
Express
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.CC = "(e-mail address removed)"
.BCC = "(e-mail address removed)"
.Subject = "This is the Subject line"
'.Body = "Hi there"
'.Attachments.Add ("C:\test.txt")
.Display
'.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing


But I do not get the mail, when .Send, and In one other workbook I get
a error message due to Option Private Module,Option Explicit "I think
so, I am not sure"

I have to display Outlook, or Outlook Express, from vba, and I can't!

Any Help..?
 
R

Ron de Bruin

Hi

If you want it to work in both programs then
the only way is to use SendMail

*******************************************
If you use this line you can choose a address in the address book or type one yourself.
And also you can type some text in the body.

ActiveWorkbook.SendMail "", "This is the Subject line"

********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top