Export To Word
Export to word is an export function used when the desired output is a word document.
We generate a sample word file where we tag the variable elements in the content and use sheetkraft to Map those tags with the data from the activity. Hence the output file contains the same Word file but not the original tags, those are now replaced by the mapped data from export to word function within Sheetkraft workbook
Step1: Create a word file and insert fields and give them tags
Step2: Use the ExportToWord UI to generate a formula mapping values to tags. This step modifies the Word file
How to create tags in Word file
There are two types of tag, static tag and repeating tag
Static is simple to understand. This is static text content control we can define in word. Within this tag we can add desired text using sheetkraft.
How to define tags
-Within MS Word, generate a desired word File and identify the variable elements in it
-Go in the Developer panel in the tool bar.
-Select the variable text.
-Click on Rich or Plain text content control.
-Properties option will then be available click on that.
-Add title and tag. Note that name of tags should not have any spaces, tags should not be repeated as well. Remember to make a separate tag for each variable even if the content is repeated. Eg. Considering Date is variable element in the document and if there are multiple places where date is required, though the date flowing to all the places are same, but every date will have its own tag with different tag name. Title will be displayed over the content on the tag it doesn’t have any major significance to the mapping.
-Above tagging mentioned is static tagging where the information will flow only in the selected selection control. If our output data has multiple row format, then we need to create a repeating control section. Eg. If the word output file has table in it, the number of rows filling the table is not necessarily constant and can change with each output, in this case we cannot go on defining static control section for each row as it is not possible. Hence there is a provision for repeat control selection. With repeat control selection you can repeat the static control selection as per your output data.
-How to define repeat section?
With the example of table output. Select the first row of the table since rows will be dynamic
-Within the same Developers Panel, you find the icon to repeat control section.
-you will have to define the repeat tag as well in the same fashion we described static tag by going in properties and adding title and tag
-Now you have created repeating section. You can now create static control selection as shown earlier within the repeat selection.
How to Map the tags
This is a very simple process. Once the tagging in the word file is over it is just simple substitution of values you want in place of those tags. Sheetkraft identifies all the tags in the selected word file. Repeating selection are also identified separately.
Within Sheetkraft workbook after clicking on export to word function you will be asked to select the word file you have created with all the tags.
-If you have correctly made your tags you will see all your tags after selecting your file. Map all the tags from the data in your workbook and you are good to go.