Help with outlook vba and managing a string

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
hey all,

I have a string that spans over several lines (example below) and I'd like to know how to cut it up so each line becomes it own variable.

To make life a little easier I have managed to get the source of this string to add end tags to the end of each line.

It's really a case of pulling the characters from between each red part for each line.

I also need the description to all be on one line as it will be pasted into a access database and I've found that access doesn't like stuff spanned over multiple lines.





[string]

This is your booking details for,some website

Date: 3/3/2009 :daend
Time: 20:00 - 23:00 :tend

Firstname: blast :fend
Lastname: man :lend
Email: [email protected] :eend
Mobile Phone: 2215488995 :mend
Home Phone: 2566845 :hend
City: southampton :cend
Description: I reakon I've broken it!!



Fix it now baby!


Blastman :dend

If any of these details are incorrect please contact [email protected]

Thanking you

[/string]





I hope that this makes sense and that someone smarter than me will be able to help.

Cheers in advance!
 
I cracked it.

I used Instr and mid to pull the data I needed.

I'm still looking for a way to strip all line brakes from a string if anyone can help.
 
yeah I just found that out!!

Description = Replace(descript, vbCrLf, " | ")


cheers for the help anyways.

:)
 
Back
Top Bottom