Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i convert string of file attachments into an array? 1

Status
Not open for further replies.

Juddy58

Technical User
Jan 21, 2003
176
AU
Hi,
Just wondering if anyone has code to convert a string with a list of file attachments eg "C:\Temp\File1.txt; C:\Temp\File2.txt; C:\Temp\File3.txt"
into an array eg,
dim ArrAttachment(4) as string
ArrAttachment(0)= "C:\Temp\File1.txt"
ArrAttachment(1)= "C:\Temp\File2.txt"
ArrAttachment(2)= "C:\Temp\File3.txt"
ArrAttachment(3)= "" 'Only 3 attachments so not used
ArrAttachment(4)= "" 'Only 3 attachments so not used

I have code that I have used before with outlook to create a collection but I now need to do this with an array. Im assuming i need to use instr to search for ";" or something. I thought this would have been done by someone else before. I have done a few searches and havn't come up with anything im after.

Any advice appreciated
thanks
Justin
 
What you need is Split.

[tt]astrFiles=Split(strFiles,";")[/tt]
 
To easy Remou, exactly what im after.
Cheers
Justin
and a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top