Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert RTF to DOCX

Former Member
0 Likes
1,436

Hi all,

I get a fomarted text using method "cl_gui_sapscript_editor=>get_text_from_editor" and then I download it in an RTF file.

I want to convert that RTF file into a DOCX file (o download the got text in DOCX file directly). Is that possible?

Thanks.

Hi all,

I get a fomarted text using method "cl_gui_sapscript_editor=>get_text_from_editor" and then I download it in an RTF file.

I want to convert that RTF file into a DOCX file (o download the got text in DOCX file directly). Is that possible?

Thanks.

2 REPLIES 2
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,086

Why do you need this?

SAP is not MS Word, so obviously it's not its purpose in general to convert a text format into MS proprietary format.

But DOCX happens to be based on XML format. And converting RTF to XML sounds like a feasible task, so I'd suggest to search further in that direction.

Read only

matt
Active Contributor
0 Likes
1,086

Yes it's possible. You can do it via OLE, or even programatically, since .docx is an open standard (in the form of zipped xml). This might be a good start https://blogs.sap.com/2015/11/16/generate-docx-file-in-abap/