Hi all,
I am creating a program to send emails with several attachments out to a database of contacts. I first set up a mail object, and define some parameters and add an initial attachment, shown below.
I then use a For loop to go through each contact to then set more parameters of the email, such as the To field and to add further, personalised attachments, but I want to preserve the above settings as a fresh email to start with on each loop. So naively I thought I could just copy the mail object, like below....Please Login or Register to view this content.
But if I edit temp_CDO_Mail, it also changes CDO_Mail, as I now realise that temp_CDO_Mail is just a pointer, rather than a distinct copy. I don't really want to just redefine CDO_Mail on each loop, because I want the code to be as fast as possible and I want to limit adding in that first attachment. So what are my options for literally copying CDO_mail into a distinct (non pointer) object?Please Login or Register to view this content.
Any searching I've done just talks about creating your own classes and cloning items/properties. But not sure this really applies with an inbuilt mail object? Can anyone help?
Many thanks,
Chris
Bookmarks