Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert txt file to HTML

Status
Not open for further replies.

Gimly

Programmer
Jan 5, 2003
26
ZA
Hi everybody,

The question I have is the following:

I have a notepad file written in HTML format (saved as txt not HTML). If i call the txt file to the webbrowser in VB, is there a way that I can convert the txt file to HTML, leaving the txt as it is when the programme closes, thus not saving it as HTML just converting it.

I have no idea how to do this, and any help or info will be greatly appreciated.

Regards
Gimly
 
Probably the easiest way would be like this...

Dim textFile As String
Dim htmlFile As String

textFile = "YourPath\YourFile.txt"
htmlFile = "YourPath\YourFile.html"

Name textFile As htmlFile 'Rename the file to html

'Use it here

Name htmlFile As textFile 'Rename file back to txt

Hope this helps.
 
Thank you very much ClickHere,

I will try that.

Regards

Gimly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top