cancel
Showing results for 
Search instead for 
Did you mean: 

MS Word in WD

OttoGold
Active Contributor
0 Kudos

Dear sirs,

I would like to ask you about the options of MS Word integration into a WD.

I have searched before asking, of course but have not found any options list any direct list of steps or something like that. I am aware there is a Office container or something but would like to get the whole picture.

When I need to flush some content into a MS Word, how can I do that?

a) can i use OLE throught WD? I think not, is that so?

b) when I create a Word as a XML file (you know that XML approach, right?), how can I return this "text" into a WD so the web browser appears if I want to open the file od save to drive (open, save, cancel dialog).

c) anything important left? Some direct WD + Office API to create a document from scratch? to create a document based on some template (like OAOR or something)?

Lets say I have a template which I can fill with data through ABAP and want to display the file. Next I expect the user will add some content. How can I return the result file back to the backend? I would like to save the file into the CS/ GOS or something.

I know how can I create the whole scenario with Adobe Forms, but the users just MUST have it done in Word. I hope anybody who knows adobe forms can understand my problem? (I can generate the PDF, use GETPDF and then send the binary data into a WD to display that, I need the same for Word... and back I can get the filled file from WD as a binary data and save it to GOS, same for Word needed).

Thank you all for your time and effort,

regards Otto

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Have you researched the OfficeControl UI element:

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

It does a lot of what you describe, but doesn't quite give you the full range of control that you might have with OLE. Still there is an event for onClose and onSave.

The alternative would be to generate the Word document (I'm guessing the XML format would be easiest) and download it using FileDownload. The user could then edit the file and chose FileUpload. That's fairly low tech, but workable.

OttoGold
Active Contributor
0 Kudos

Thank you Mr. Jung, I have already been through the link, but not understand much of what is described there.

I cannot see a way how can I actually write something into the Word file. I guess that is a lack of skills in WD ABAP:)) Could you please point me to any demo program? I probably need to see some data going through the interface to understand. Somethink like in the Word OLE tutorials or something like that.

See (for example) first: this is the text you´re going to write in the file, see next: this is how the program goes and at the end: this is what you get. I was not able to find anything near to this.

Or it is only a browser/ container and I am supposed to "create" the file in a program and send only the result into the WD?

and download it using FileDownload. The user could then edit the file and chose FileUpload.

I thought I can create some content for the Word file and flush the content into the WD container/ opened file, the user can add something here and there and when clicking save I can get the file back into the program. Something like when using portal, when the versioning is on. The portal opens the document for you in the Word, you change the document and the portal saves it back and create a version for that. Of course I don´t need any versioning, I only need to get the stream of data.

I can do it the same way with the Adobe form so I thought it might be possible to do that with Word?

Thank you for your time and effort,

Otto

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

> can do it the same way with the Adobe form so I thought it might be possible to do that with Word?

It doesn't work exactly like adobe. There is a dataSource property but that is type XSTRING. This UI element expects the entire Word Document in this property. Adobe is more sophisticated in that you can bind to a context and then in turn bind attributes of that context to individual fields. With OfficeControl you have to pass the entire completed document. It is best to use the XML format of Word. This way you can parse in dynamic data by putting it into the XML file. You can in turn extract data during the onSave or onClose event. The OfficeControl still has better integration than just the upload/download since it removes these steps from the user. However data popuplation or extraction would require the same effort in both approaches.

There are examples in the Package SIOS.

OttoGold
Active Contributor
0 Kudos

Awesome explanation, thank you!

Former Member
0 Kudos

Hi Mr. Jung,

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?

Can you give me some suggestion or solutions?

Thanks a lot!

Best Regards,

Derek Zhao

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Derek - you have violated several of the forum rules of engagement. Do not double post your questions. You have already posted this question standalone here:

Do not attach new questions to the ends of existing threads - particluarly if they have already been resolved.

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Gold,

I guess you can integrate MS- word by using Office control UI element .. but for this you need to active " ACTIVE X" i Browser.

if it helps pl rate me

cheers,

Kranthi.