Scripting question, Formatting Text

Line Breaks

I'm working on a macro that pulls in text from an XML document. I am trying to combine several elements of the XML file into one string with line breaks. Combining them into one string works great, however I cannot get the line breaks to work. Here is what I have tried:

Object.Text = "Writer: " & DesktopX.ScriptObject("Comic_Window").Writer1 & "/nArtist: " & DesktopX.ScriptObject("Comic_Window").Artist1

and

Object.Text = "Writer: " & DesktopX.ScriptObject("Comic_Window").Writer1 & "<br />Artist: " & DesktopX.ScriptObject("Comic_Window").Artist1


Both examples type out the line break code in the text box. I believe it is not evaluating this string for any html script. Is there something I can do to break this string into multiple lines?

Thanks,
Greg
3,479 views 5 replies
Reply #1 Top
Have you tried vbcrlf? Like this:

Object.Text = "Writer: " & DesktopX.ScriptObject("Comic_Window").Writer1 & vbcrlf & "Artist: " & DesktopX.ScriptObject("Comic_Window").Artist1

Reply #2 Top
Thank you so much sViz, that worked perfectly.

I had read so many tutorials and tried searching online for that solution, but not once has vbcrlf come up. This makes me wonder, how many other script hints am I missing out on.

If you know of any resource I could use to help me figure out this scripting, I'd appreciate it.

My next challenge is importing images using the url path I've pulled from the XML, and I'm at a loss on how to pull that off.

Thanks again,
Greg
Reply #3 Top
Your welcome.

The number 1 recommendation would be w3schools.com

They've got a whole section on Vbscript - HERE

And of course there's always here on the WC forums.

Reply #4 Top
/n is a string feature in Javascript. In VBS you have to use vbcrlf.
Reply #5 Top
vbcrlf...
dagnammit, I've been messing with CHR(13) and (11) (or whatever) combinations forever.....
cheers ^_^