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

Microsoft word content control

MariaJooRocha
Contributor
0 Likes
2,660

Hi SCN,

I've a word template with content control. My goal is to generate the word document with data from SAP.

I've seen the blog: Generating Microsoft Word Doc with dynamic data and other documentation.

Already did the dowload of the Microsoft Word Content Control Tool Kit from http://dbe.codeplex.com/.

How to install the content control toolkit (to bind content controls to the custom XML part)?

Thanks.

Maria João Rocha

7 REPLIES 7
Read only

DoanManhQuynh
Active Contributor
0 Likes
1,852

idk about the approach you talked about but i can suggest you a difference way: using BDS with mail merge interface ( sample program SAPRDEMO_MAILMERGE_INTERFACE ) or form interface ( SAPRDEMO_FORM_INTERFACE ).

Read only

0 Likes
1,852

Thanks Manh,

I tried that approach as you can see Desktop Office Integration word form.

The word template has not form fields neither merge fields. The document is based on content control fields and can't be changed (it's from other company/institute).

Our task is to fill automatically the word with data from SAP .


Regards,

Maria João rocha

Read only

1,852

you may read this blog series, it also have mapping for content control, and as it based on OOXML, you can do more than just binding field:

https://blogs.sap.com/2017/04/24/openxml-in-word-processing-custom-xml-part-mapping-structured-data/

There is also have document builder, but it may be more complex than OOXML:

https://wiki.scn.sap.com/wiki/display/DocBuilder/Content+Controls+-+Mapping+Variables

Read only

0 Likes
1,852

Hi,

Thanks again.

I'm on Netwaver 7.00, without class CL_DOCX_FORM, but luckily in short term we will move to 7.02 🙂

I'm gona wait for this version.

Regards.

Maria João Rocha

Read only

0 Likes
1,852

Hi,

Thanks. I must use word content control. The word document comes from outside, we can't changed it.

Regards,

Maria João Rocha

Read only

1,852

its may be more complicate if you dont have those class, as you see docx is zipped from various xml file so incase you dont have cl_docx_form, you might try to build your own xml files and combine it using transformation. based on the link i sent you, its quite clear how to map custom xml file to docx. did you have 7.02 yet?

Read only

MariaJooRocha
Contributor
0 Likes
1,852

Hi,

On SAP Netweaver 7.02 already with CL_DOCX_FORM and it works :).

1 - Mapping custom XML manually. Developer Tab–>XML Mapping Pane

(https://blogs.sap.com/2017/04/24/openxml-in-word-processing-custom-xml-part-mapping-flat-data/)

2 - Used example program (ZDOCX_DOCUMENT) to format the content control fields.

Thanks. Regards.

Maria João Rocha