Compnut24, that was an interesting piece of code you pointed out. I downloaded it but I couldn't get it to work properly.
There appears to be a bug in the loop that scans the body of the rich text. I emailed the author to see if he was aware of any issues.
Back to your original question. You need to click Project, then Add Module. Browse for RTF2HTML.BAS and double-click it.
After opening the file you will see this:[tt]
Function RTF2HTML(strRTF As String, Optional strOptions As String) As String[/tt]
This is the header for the function you want to incorporate and gives you some clues about the way you should call it from your program. The strOptions parameter is optional but here are the options you might want to pass:
+H add an HTML header and footer
+G add a generator Metatag
+T="MyTitle" add a title (only works if +H is used)
After placing a command button and a text box on a form, here's what I did to test the function:
[tt]
Private Sub Command1_Click()
Dim strRTF As String
Dim strOptions As String
MyFile$ = "C:\VBLinks.rtf"[/tt] 'the name of my RTF file[tt]
ff = FreeFile
Open MyFile$ For Binary As #ff
strRTF = String$(Lof(ff), 32) [/tt]'a string the size of my file[tt]
Get #ff, 1, strRTF [/tt]'read the file into the strRTF string[tt]
Close #ff
strOptions = "+H+G+T=""This is the HTML Title"""[/tt]
' Then place the results in the text box[tt]
Text1.Text = RTF2HTML(strRTF, strOptions)
End Sub
[/tt]
Let me know if you have any success with the RTF2HTML function. It looks like a pretty neat piece of work.
Alt255@Vorpalcom.Intranets.com