Hi all,
I have an issue with code for a button that sends an email:
the strEmail has loads of text (which i've not pasted due to length) but i have 2 different types of emails to send depending on values on the record...
i'm trying to write some code so the .htmlbody is strbody1 or strbody2 depending on values on the record.
something like StrEmail = If (field 1 = "test" or "test2") then strbody1
else
If (field 1 = "test3" or "test4") then strbody2
End IF
But i'm having problems working this out?
any help would be appreciated
I have an issue with code for a button that sends an email:
Private Sub Command41_Click()
Dim OApp As Object, OMail As Object, signature As String
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
signature = OMail.HTMLBody
With OMail
.To = Forms!Customer!EmailAddress
.Subject = Reference: " & REFERENCENUMBER
.Attachments.Add ("C:\Help\Test.txt")
.HTMLBody = strEmail & signature
'.Send
End With
Set OMail = Nothing
Set OApp = Nothing
Me.email sent = 1
End Sub
the strEmail has loads of text (which i've not pasted due to length) but i have 2 different types of emails to send depending on values on the record...
i'm trying to write some code so the .htmlbody is strbody1 or strbody2 depending on values on the record.
something like StrEmail = If (field 1 = "test" or "test2") then strbody1
else
If (field 1 = "test3" or "test4") then strbody2
End IF
But i'm having problems working this out?
any help would be appreciated
