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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ricardo de Mila
    New Member
    • Jan 2011
    • 41

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

    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(.HTMLBo dy, "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
    Last edited by Ricardo de Mila; May 19 '17, 01:11 PM. Reason: I have found the solution to the doubt. Want to contribute informing here.
Working...