Since I was writing a subroutine to be used like a utility, the content parameters were optional. That way, I could call the subroutine with a distribution list or without, with or without someone for the CC list, with or without Subject or a message for the body. All worked fine with optional parameters. As a reminder, there is the code so far:
.To = Recipients
.CC = CopiesTo
.Subject = Subj
This called for another optional parameter, AttachmentLocation and this to the With EmailItem block
It worked properly if there was a valid string passed through AttachmentLocation but error-ed when AttachmentLocation was not available. In this case the action needed to be executed after the With EmailItem block, with a controlling If.
If (AttachmentLocation) Then