is there a RTFToHTML() Function in Harbour ?

is there a RTFToHTML() Function in Harbour ?

Postby Jimmy » Fri Sep 27, 2024 1:52 pm

hi,

just a Question : is there a RTFToHTM() Function in Harbour :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby karinha » Fri Sep 27, 2024 3:20 pm

Jimmy wrote:hi,

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


By Rochinha.

http://www.pctoledo.com.br/forum/viewtopic.php?f=39&t=15459

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7828
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

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

Postby Otto » Fri Sep 27, 2024 3:33 pm

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 view  RUN



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 view  RUN
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.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby Jimmy » Fri Sep 27, 2024 5:07 pm

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
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Otto » Fri Sep 27, 2024 5:18 pm

RTFToHTM() open the RTF ans saveas HTML
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 42 guests