string to varian conversion

edojan

Registered User.
Local time
Today, 00:32
Joined
Dec 19, 2006
Messages
26
I HAVE A STRING A THAT HAS EMAILS EX: ABS@XYZ.COM,ABC2@XYZ.COM ...
I need to convert it to format below ... how can i do this without manually typing stuff out?

Dim recip(25) as variant
recip(0) = "emailaddress1"
recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip
 
Look in VBA Help at the Split function.
 
Keep in mind, if there is a possibility that the string isn't always consistent (e.g. some emails are separated by a semi colon and other with a comma or there's an extra space or carriage return), you may need to run through the code few times with different separator to extract emails successfully.
 

Users who are viewing this thread

Back
Top Bottom