using variable in subject when send mail

A

alvin Kuiper

Hi
I have this
With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr, _
FileFormat:=FileFormatNum
'On Error Resume Next
.SendMail "(e-mail address removed)", _
"hej"
On Error GoTo 0
.Close SaveChanges:=False
End With
But if i use this:
..SendMail "(e-mail address removed)", _
"hej" & variable

I get an error ?

Alvin
 
J

Jacob Skaria

Dear Alvin

Use .SendMail Subject:= .........like below

Dim strSubject As String
strSubject = "Test Email"

ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", _
Subject:=strSubject

If this post helps click Yes
 
A

alvin Kuiper

Yes yes yes
Thanks
alvin


"Jacob Skaria" skrev:
Dear Alvin

Use .SendMail Subject:= .........like below

Dim strSubject As String
strSubject = "Test Email"

ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", _
Subject:=strSubject

If this post helps click Yes
 

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