By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

vbCrLF issues while trying to replace a sentence in a HTML e-mail model.

P: 35
Hello everybody, good morning.
Once more I come to you to request some help for VBA and other information.

This time, I am facing some problems to change a sentence in the body of an HTML e-mail due to the need of changing the line in the new sentence.

Please consider the following.

In my original .oft file (Outlook's e-mail model), the e-mail body contains a string that is "ItmLst".

In other point of the software I have a variable called Lst that contains a list of lines that I would to use to replace the string "ItmLst". The content of this variable is another string like
"xxxxxxxx: xxxxx xxxx: xxxxxxx xxxxx: xxxx" + vbCrLf + " yyyyy yyyy: yyyyyyy yyyyy: yyyy" + vbCrLf +
" zzzzz zzzz: zzzzzzz zzzzz: zzzz"

My sentence to replace both strings is

.HTMLBody = Replace(.HTMLBody, "ItmLst", Lst).

But when I do that and the original information in .HTMLBody is replaced, all the vbCrLf information, just desappear.
Similarly the duplicated spaces also disappear.

Could somebody help me to solve this question or lead me to some text for me to read in order to help?
I have tryed to understand some existing texts, but really could nod find the solution.

Best regards

Ricardo



Hi Everybody...
Just few minutes after inserting the information here, reading some other information, I have learned that in HTML we don't use vbCrLf but <br/> instead.
Also about the spaces, I have noticed that HTML will condense multiple characters chr$(32) in just one chr$(32), but this will not occour if I use chr$(160) instead.

Thank you any way...
Best regards
May 19 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.