In the macro below, I only want to add an attachment to an email if the variable cur_num is greater than zero. So I tried the If statement shown, but I find that this does not work in the With block.
Could someone help me out.
Thanks,
MikeG
===============================================
With OutMail
.To = a
.CC = b
.BCC = ""
.Subject = c
.body = d
If cur_num > 0 Then
.Attachments.Add ActiveWorkbook.FullName
End If
.display
End With
Could someone help me out.
Thanks,
MikeG
===============================================
With OutMail
.To = a
.CC = b
.BCC = ""
.Subject = c
.body = d
If cur_num > 0 Then
.Attachments.Add ActiveWorkbook.FullName
End If
.display
End With