Page 1 of 1

is there a RTFToHTML() Function in Harbour ?

Posted: Fri Sep 27, 2024 1:52 pm
by Jimmy
hi,

just a Question : is there a RTFToHTM() Function in Harbour :?:

Re: is there a RTFToHTML() Function in Harbour ?

Posted: Fri Sep 27, 2024 3:20 pm
by karinha
Jimmy wrote:hi,

just a Question : is there a RTFToHTM() Function in Harbour :?:
By Rochinha.

http://www.pctoledo.com.br/forum/viewto ... 39&t=15459

Regards, saludos.

Re: is there a RTFToHTML() Function in Harbour ?

Posted: Fri Sep 27, 2024 3:33 pm
by Otto
Dear Jimmy,

Do you have Word installed?
Then you can open many formats with the Word object and save them in others.
Best regards,
Otto

Code: Select all | Expand



oMail := oOutlook:CreateItemFromTemplate( Alltrim(  cFile ) )

   //olHTML    5  HTML format (.html) oMail:SaveAs  ( cZielVerzeichnis  + "\" + cFileNoExt(cVData) + "_fromEmail.html", 5  )
   oMail:SaveAs  ( cSaveAsRTFFile, 1  )

   oWord := CreateObject( "Word.Application" )

   oDoc := oWord:Documents:Open( cSaveAsRTFFile )
   oDoc:SaveAs( cSaveAsHTMLFile, 10 )
   oWord:Visible := .t.

   oWord:PrintOut()
   oDoc:Close()
   oWord:Quit()

  
In the Word object, there are several constants for different file formats when using the SaveAs method. The specific constant you need depends on the version of Word. Here are some commonly used constants for the SaveAs method:

Code: Select all | Expand

wdFormatDocument: 0 - Saves as a Word document (.docx)
wdFormatRTF: 1 - Saves as an RTF file
wdFormatText: 2 - Saves as a text file (.txt)
wdFormatHTML: 10 - Saves as an HTML file (.html)
wdFormatXMLDocument: 12 - Saves as an XML document (.docx)
wdFormatPDF: 17 - Saves as a PDF file (.pdf)
wdFormatXPS: 18 - Saves as an XPS file (.xps)

 
These constants are typically defined in the Word namespace. You can use them to specify the corresponding formats in your SaveAs method.

Re: is there a RTFToHTML() Function in Harbour ?

Posted: Fri Sep 27, 2024 5:07 pm
by Jimmy
hi Otto
Otto wrote: Do you have Word installed?
Then you can open many formats with the Word object and save them in others.
i do not want to convert a RTF.
i got a Link from karinha and it seems what i´m searching

Re: is there a RTFToHTML() Function in Harbour ?

Posted: Fri Sep 27, 2024 5:18 pm
by Otto
RTFToHTM() open the RTF ans saveas HTML