Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / February 2004



Tip: Looking for answers? Try searching our database.

Creating HTML - string problem??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ricky - 28 Feb 2004 16:44 GMT
I'm using the following Function code to create an HTML page:

Function FormatHTML() As String
Dim myHTML As String
myHTML = "<HTML><H2><center><font color=Blue><b>Daily Operations
Status   Report</b></font></h2></html>"
myHTML = myHTML & "<body><h3 align=left><font
color=red><u><b>Critical Application Cycle End
Times</b></font></u></h3>"
myHTML = myHTML & "<h3 align=left>&nbsp;&nbsp<b>Insurance</b></h3>"
myHTML = myHTML & "<p
align=left>&nbsp;&nbsp;&nbsp;&nbsp;&bull;<b>Insurance DataBase
(Critical Path - BT30004) ended at: " & htmlBT4 & "</b></p>"
  myHTML = myHTML & "<p align=left>&nbsp;&nbsp;&nbsp;&nbsp;" &
htmlMVS & "</p>"
End If
myHTML = myHTML & "</body></html>"
FormatHTML = myHTML
End Function

I call the function(FormatHTML) in an Outlook routine which works
great. The problem is the last variable called: htmlMVS. When I do a
debug.print htmlMVS it displays as multiple lines of text, example:
bt30004->bt50001
is00075
hi30004->hi50001

But, when I open the email web page it displays like this:
bt30004->bt50001 is00075 hi30004->hi50001

It's all in one line of text. I need it to display as the user enters
it in the textbox which is in multiple lines and the debug statement
confirms that. I parse the textbox and replace vbCrLf with vertical
tab, that way I don't display control or line feed characters. I hope
someone has an idea for me to try.

Rich
radicaledward - 28 Feb 2004 17:24 GMT
First off it looks like you have some incorrect syntax in your HTML for
example:

>  myHTML = "<HTML><H2><center><font color=Blue><b>Daily Operations
> Status   Report</b></font></h2></html>"

You shouldn't have a </html> until the end of the webpage, and that can
cause some problems in browsers. As for the htmlMVS - if you are using
standard linefeeds on it will not parse as a line feed in a browser - you
must use a <br> or <p> tag. Web browsers are set up to ignore white space
unless told otherwise with the <pre> tag which indicates preformatted text.
Check to see if it works if you do this:

myHTML = myHTML & "<p align=left>&nbsp;&nbsp;&nbsp;&nbsp;<pre>" & htmlMVS &
"</pre></p>"

> I'm using the following Function code to create an HTML page:
>
[quoted text clipped - 33 lines]
>
> Rich
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.