tobey1
asked on
Writing an HTM File from a Textbox or Rich Textbox
I need to write a file from the data this is entered into a RichTextBox to an HTM document. I have written it to a RTF, but when I try to recall that file as part of a web page, using IFRAME (Cause OBJECT won't work), I get the text editor window with the test. If my information is saved as an HTM, then I get the result in my web for that I need.
Thanks,
Joe
Thanks,
Joe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry. If you click on the link, it will open it in the Explorer. Please Right click the above link and choose Save Target As...
Thanks
Thanks
ASKER
What exactly is that link giving me and how can I use it in my ActiveX form?
Thanks for accepting my comments.
Sorry. I've never seen your question in this question as I've forgotten answering this question.
The answer for ur question is...
Juse place a WebBrowser control in your form and an RichTextBox control with a command button named Show.
'Place the following code in the event as mentioned
Private Sub Command1_Click()
With WebBrowser1
.Document.Script.Document. Clear
.Document.Script.Document. Write Module1.RTF2HTML(RichTextB ox1.TextRT F)
.Document.Script.Document. Close
End With
End Sub
Sorry. I've never seen your question in this question as I've forgotten answering this question.
The answer for ur question is...
Juse place a WebBrowser control in your form and an RichTextBox control with a command button named Show.
'Place the following code in the event as mentioned
Private Sub Command1_Click()
With WebBrowser1
.Document.Script.Document.
.Document.Script.Document.
.Document.Script.Document.
End With
End Sub
strHTML = replace(rtbInfo.Text, vbnewline, "<P>" & vbnewline)
When you output strHTML, it will have the line breaks at the proper place. If you want to get fancier, you can also output it with a header and footer:
open "my_RTF.htm" for output as #1
print #1, "<HTML>"
print #1, "<HEAD>"
print #1, "<TITLE>This used to be RTF</TITLE>"
print #1, "</HEAD>"
print #1, ""
print #1, "<BODY>"
print #1, strHTML
print #1, "</BODY>"
print #1, "</HTML>"
close #1