Originally Posted by
matey56
I know how to write a basic If Then Else statement, but I don't know how to write it to change out the body of an email. Can you assist? Sorry, I barely know VBA.
Well you really need to start as the If Else construct is one of the easiest.
I would dim two string variables, strP2P and strM2M
Then assign their values.
Then decide which you want to use?
Code:
Dim strP2P As String, strM2M As String
strP2P = "Dear " & User & ",<P>" & "The " & Comparison_Type() & " comparison of " & Product() & " has been completed. Please review the notes below." & "<P>" & Comments
strM2M = "Dear " & User & ",<P>" & "The " & Comparison_Type() & " comparison of " & WhateverMIs() & " has been completed. Please review the notes below." & "<P>" & Comments
If Comparison_Type = P2P Then
msg = strP2P
Else
msg = strM2M
EndIf
However I am not sure what you are doing with () after these names. They are controls or fields. If controls then I would be prefixing them with Me. They are not functions?, so unsure how what you have is even working correctly?