default email addresses (1 Viewer)

Dannyc989

Registered User.
Local time
Today, 10:37
Joined
Dec 18, 2013
Messages
46
Folks, I have the code below but the line in red comes up when I type it.

I basically want to put 3-4 peoples emails on this line so an email is sent to them people only when the form is opened from a previous forms command click. Anyone able to help??

Dim OutlookApp As Object
Dim MailIt As Object
Dim EmailAddr As String

Set OutlookApp = CreateObject("Outlook.Application")

'Email Addresses

EmailAddr = d.collins@btinternet.com

'Create Mail Item
Set MailIt = OutlookApp.CreateItem(0)
With MailIt
.To = EmailAddr
.Subject = "New Project"
.Body = Me.Project_Number & ", " & Me.Client & ", " & Me.Site_Reference & ", " & Me.Description
.Display
End With
 

llkhoutx

Registered User.
Local time
Today, 04:37
Joined
Feb 26, 2001
Messages
4,018
Why can't you concantenate them, separating each with a semi-colon?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:37
Joined
Aug 30, 2003
Messages
36,127
Your error is because it wants a string:

EmailAddr = "d.collins@btinternet.com"
 

Users who are viewing this thread

Top Bottom