hi all. i am getting an error in my coding that i suspect may have a sinple resolution. the purpose of my form is to send emails and i have the To: and Cc: lines are predetermined. the problem that i am running into is in my subject line. below is a sample of my coding...
the problem i am sure is within the .subject line. any help would be appreciated.
Thanks!
Code:
Private Sub Command20_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim MYDate
Dim test1
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
MYDate = Date
test1 = tes
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = [EMAIL="test@test.com"]test@test.com[/EMAIL]
.CC = "[EMAIL="test1@test1.com"]test1@test1.com[/EMAIL]"
.Subject = MYDate test
.HTMLBody = Me.Mess_Text
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.Send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub
Thanks!