Ashley:
Got just what you need.
I also encountered various problems when publishing hover text to the web that required me to A) hack at Visio, and B) diddle the HTML when the hacking failed. But I eventually got what I needed,
a macro for publishing a drawing to the web that sets the proper Visio options and automatically edits the main HTML source and each individual HTML page to fix all the anomalies. With a minor modification, you can use the macro to address your line break issue (and maybe a number of other issues you’re not yet aware of).
The way I’d suggest you approach it is a two-step process:
1) In Visio, put in some unique string where you’d like to see a line break, such as “~”;
2) Edit the final HTML to replace the “~” with the HTML code for a line break, specifically “ ”.
You can manually edit each of the generated HTML files, but the easier way is to use the
web publishing code I mention above and add one more edit. Where it says, “Remove floating page name (only appears in IE)”, add the following:
Const Marker = "~"
Do Until I = 0
I = InStr(1, AString, Marker)
If I > 0 Then
AString = Left(AString, I - 1) & " " & Right(AString, Len(AString) - I - (Len(Marker) - 1))
End If
Loop
When you run the entire macro, it’ll automatically replace the “~” with the HTML new line code. Of course you can use other marker characters besides the tilde; just be sure to change the Const in the code above. FYI I tried using CHAR(10) as the marker, but it always grabbed the end of every line. Not good. I also tried CHAR(13) (i.e., carriage return), but Visio translates it into a space somewhere along the line such that it doesn’t appear in the HTML. I also tried using <br>, but it doesn’t work inside quotes. There may be other solutions, but at least this one works.
Good luck!
- Ken