Hi
I am a bit new to all this, so bare with me.
I have this piece of VBA which sends and email in HTML format. What i want to is if ITSQFList has text then add the statement "with the following points to note" after ITSQFQualityGate. If it is empty then there is no statement.
Any suggestions will be greatly appreciated.
CODE GIVEN BELOW.
Private Sub cmdSend_Click()
Dim strEmail, HTML As String
Dim objOutlook As Object
Dim objEmail As Object
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
strEmail = txtEmail
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<body bgcolor=""#FFFFFF"">"
HTML = HTML & "<P><font size=""3"" face=""Optima"">"
HTML = HTML & ITSQFDocumentName & " received from " & ProjectServiceDesigner & _
":" & "<Strong>" & " '" & ProjectName & "'" & "</Strong>" & "- PAR " & ProjectPAR & Chr(13) & Chr(13) & "<BR>"
HTML = HTML & "Go Live - " & ProjectLiveDate & Chr(13) & "<BR></P>"
HTML = HTML & "<P>" & ProjectSummary & Chr(13) & "<BR> </P>"
HTML = HTML & "<P>" & ITSQFServRecommendation & Chr(13)
HTML = HTML & ITSQFQualityGate & Chr(13) & "<BR>"
HTML = HTML & ITSQFList & Chr(13) & "<BR> </P>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
objEmail.HTMLBody = HTML
'***creates and sends email
With objEmail
.To = ITSQFEmail
.Subject = "ITSQF Submission"
.HTMLBody = HTML
.Attachments.Add (ITSQFDocumentAddress)
.Send
End With
Set objEmail = Nothing
DoCmd.Close
I am a bit new to all this, so bare with me.
I have this piece of VBA which sends and email in HTML format. What i want to is if ITSQFList has text then add the statement "with the following points to note" after ITSQFQualityGate. If it is empty then there is no statement.
Any suggestions will be greatly appreciated.
CODE GIVEN BELOW.
Private Sub cmdSend_Click()
Dim strEmail, HTML As String
Dim objOutlook As Object
Dim objEmail As Object
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
strEmail = txtEmail
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<body bgcolor=""#FFFFFF"">"
HTML = HTML & "<P><font size=""3"" face=""Optima"">"
HTML = HTML & ITSQFDocumentName & " received from " & ProjectServiceDesigner & _
":" & "<Strong>" & " '" & ProjectName & "'" & "</Strong>" & "- PAR " & ProjectPAR & Chr(13) & Chr(13) & "<BR>"
HTML = HTML & "Go Live - " & ProjectLiveDate & Chr(13) & "<BR></P>"
HTML = HTML & "<P>" & ProjectSummary & Chr(13) & "<BR> </P>"
HTML = HTML & "<P>" & ITSQFServRecommendation & Chr(13)
HTML = HTML & ITSQFQualityGate & Chr(13) & "<BR>"
HTML = HTML & ITSQFList & Chr(13) & "<BR> </P>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
objEmail.HTMLBody = HTML
'***creates and sends email
With objEmail
.To = ITSQFEmail
.Subject = "ITSQF Submission"
.HTMLBody = HTML
.Attachments.Add (ITSQFDocumentAddress)
.Send
End With
Set objEmail = Nothing
DoCmd.Close