cancel
Showing results for 
Search instead for 
Did you mean: 

Can I extract plain text from Word Doc in OfficeControl?

Former Member
0 Kudos

Hi Everyone,

I am doing a task to embed MS Word in Web Dynpro.

Using SAP UI element OfficeControl to realize it.

The link is: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm

I read the Demo Source Code for OfficeControl in Package "SIOS".

OfficeControl can create, open, save and close a MS Word Doc, -


It's very good!

The Content of Word Doc in OfficeControl is saved as XString format, (usually include plain text, different font, style, color or image,)

Can I extract plain text from the content of Word Doc in OfficeControl?

I used the function modules ECATT_CONV_XSTRING_TO_STRING,

I got run-time dump. (I think the XString Format of Word Doc is different from ordinary XString Format, so I got run-time error.)

How can I extract plain text from the content of Word Doc in OfficeControl? (Save the Word Doc in XML format?)

Can you give me some suggestion or solutions?

Thanks a lot!

Best Regards,

Derek Zhao

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I think the XString Format of Word Doc is different from ordinary XString Format

I don't know what an "ordinary" XSTRING is. XSTRING simply means any byte array. It often is a byte arrary containing any number of internal formats (images, documents, etc). In this case it contains the binary, propriatery format of the Microsoft office document. The Microsoft format doesn't store the document data in plain text. It has a complex internal format. Your best case would be to start with an XML based Microsoft Office document. Then when you get the XSTRING back from the OfficeControl it will at least be XML. You still have to parse the XML to extract your content.

Former Member
0 Kudos

How can I start with an XML based Microsoft Word in Web Dynpro?

Can you give me some suggestions?

Many thanks!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are you starting with some sort of template or just a blank document? Either way, go into Word and save the file as XML. Then upload this XML based Word Document as your starting file for editing in the OfficeControl.

Former Member
0 Kudos

It seems not easy to extract plain text from Word Doc in OfficeControl.

I decide to use "Formatted Text Edit/Formatted Text View" to save and display image in Web Dynpro.

Thank you very much,

Former Member
0 Kudos

This message was moderated.

Answers (0)