store file in string...not openfile

  • Thread starter Thread starter Trint Smith
  • Start date Start date
T

Trint Smith

How can I store an entire html file in a string with all it's formating,
double quotes, multiple lines and all??
like this:

Dim FileString As String = ENTIRE HTML FILE

thanks,
Trint

.Net programmer
(e-mail address removed)
 
Trint,
Have you tried the code in your previous message, only with double nested
quotes?

Dim file As String = "<html xmlns:v=""urn:schemas-microsoft-com:vml""" _
"xmlns:o=""urn:schemas-microsoft-com:office:office""" _
"xmlns:dt=""uuid:C2F41010-65B3-11d1-A29F-00AA00C14882""" _
...

Because its a "constant" it will be evulated at run time as a single string.

However! rather then go through the tedium of typing that, I would consider
embedding the HTML file as a resource into my assembly, then read the
resource into the string when I needed it.

I don't have a specific sample of embedding an HTML file, however I would
start here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriUsingResources.asp

Hope this helps
Jay
 
Back
Top