Changes

Jump to: navigation, search

Custom Field Type: Special – MS Word Merge

10,134 bytes added, 18:14, 4 December 2018
no edit summary
This field type provides the ability to dynamically create an MS Word document from underlying [[SmartSimple]] data. __TOC__
The feature works as follows:==General Description==* Any MS Word document can be used, up This field type provides the ability to and including MS Word 2007 documents. * You can use a normal Word document (doc or .docx), or you can use Word templates (.dot or .dotx).* You must first dynamically create a document which includes the an MS Word Form Fields to be populated by SmartSimple. Each Form Field must be provided with a name (called a '''Bookmark''' in MS Word). This name will be used to link the form field on the Word document to a Standard or Custom Field within from underlying [[SmartSimple]]data.
Configuring a Word Merge in SmartSimple is a three-step process:
==To add # Create the MS Word document that will be used as the template. (See [[Adding Form Fields to a MS Word Document:==]] for instructions.)<u>MS Word 2000-2003:</u>* From the '''View''' Menu select '''Toolbars''' and enable # Upload the '''Forms''' Toolbar* Click in your Word document wherever you wish to insert a Form Field[[SmartFolder]]. (See [[Uploading Word Merge Document to a SmartFolder]] for instructions.)* On the Forms Toolbar click on the first button # '''This page describes how to insert create a Form Custom Field into your document: [[ImageType:FormsToolbar.gif]]* RightSpecial -click on MS Word Merge custom field that maps the Form Field and select Properties. Then provide a name for SmartSimple fields you wish to merge to the field in the Bookmark sectionWord template.'''
<u!--<span class="mceNonEditable template" id="bs_template:@@@TPL0@@@" data-bs-name=" FieldOptions" data-bs-type="template" data-bs-id="0">MS Word 2007<span class="mceNonEditable template" id="bs_template:@@@TPL0@@@" data-bs-name=" FieldOptions" data-bs-type="template" data-bs-id="0"><span class="mceNonEditable template" id="bs_template:@@@TPL0@@@" data-bs-name=" FieldOptions" data-bs-type="template" data-bs-id="0"><span class="mceNonEditable template" id="bs_template:@@@TPL0@@@" data-bs-name=" FieldOptions" data-bs-type="template" data-bs-id="0"><span class="mceNonEditable template" id="bs_template:@@@TPL0@@@" data-bs-name=" FieldOptions" data-bs-type="template" data-bs-id="0"><span class="mceNonEditable template" id="bs_template:@@@TPL0@@@" data-bs-name=" FieldOptions" data-bs-type="template" data-bs-id="0">{{ FieldOptions }}</span></span></span></span></uspan></span>-->* Click on the Menu button and select '''Word Options'''<!--<span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name="AppearMandatory" data-bs-type="template" data-bs-id="2"><span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="2"><span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="2"><span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="2"><span class="mceNonEditable template" id="bs_template:@@@TPL1@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="1"><span class="mceNonEditable template" id="bs_template:@@@TPL1@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="1"><span class="mceNonEditable template" id="bs_template:@@@TPL1@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="1">{{ AppearMandatory }}</span></span></span></span></span></span></span>* In the '''Popular''' selection ''Show Developer Tab in the Ribbon''<span class="mceNonEditable template" id="bs_template:@@@TPL3@@@" data-bs-name="ToolTip" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template:@@@TPL3@@@" data-bs-name=" ToolTip" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template:@@@TPL3@@@" data-bs-name=" ToolTip" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template:@@@TPL3@@@" data-bs-name=" ToolTip" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name=" ToolTip" data-bs-type="template" data-bs-id="2"><span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name=" ToolTip" data-bs-type="template" data-bs-id="2"><span class="mceNonEditable template" id="bs_template:@@@TPL2@@@" data-bs-name=" ToolTip" data-bs-type="template" data-bs-id="2">{{ ToolTip }}</span></span></span></span></span></span></span>* Click in your Word document wherever you wish to insert a Form Field.* On the Developer Menu select the '''Legacy Tools''' icon which is in the Controls section<span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name="HideFieldForNewRecord" data-bs-type="template" data-bs-id="4"><span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name=" HideFieldForNewRecord" data-bs-type="template" data-bs-id="4"><span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name=" HideFieldForNewRecord" data-bs-type="template" data-bs-id="4"><span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name=" HideFieldForNewRecord" data-bs-type="template" data-bs-id="4"><span class="mceNonEditable template" id="bs_template:@@@TPL3@@@" data-bs-name=" HideFieldForNewRecord" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template: [[Image@@@TPL3@@@" data-bs-name=" HideFieldForNewRecord" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template:2007Forms.gif]]* On the Legacy Forms menu click the first icon to insert a Form Field.* Right@@@TPL3@@@" data-bs-click on the Form Field and select Properties. Then provide a name for the field in the Bookmark section.=" HideFieldForNewRecord" data-bs-type="template" data-bs-id="3">{{ HideFieldForNewRecord }}</span></span></span></span></span></span></span>
<span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name="OptionsTab" data-bs-type="template" data-bs-id="5"><span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name=" OptionsTab" data-bs-type="template" data-bs-id="5"><span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name=" OptionsTab" data-bs-type="template" data-bs-id="5"><span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name=" OptionsTab" data-bs-type="template" data-bs-id="5"><span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name=" OptionsTab" data-bs-type="template" data-bs-id=Upload to SmartFolder"4"><span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name=" OptionsTab" data-bs-type="template" data-bs-id="4"><span class="mceNonEditable template" id="bs_template:@@@TPL4@@@" data-bs-name=" OptionsTab" data-bs-type="template" data-bs-id="4">{{ OptionsTab }}</span></span></span></span></span></span></span>When the document<span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name="AppearMandatory" data-bs-type="template" data-bs-id="6"><span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="6"><span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="6"><span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="6"><span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="5"><span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="5"><span class="mceNonEditable template" id="bs_template:@@@TPL5@@@" data-bs-name=" AppearMandatory" data-bs-type="template" data-bs-id="5">{{ AppearMandatory }}</span></span></span></span></span></span></span><span class="mceNonEditable template is ready it must be uploaded to a [[Smart Folder]].Once it has been uploaded take note of the ID of either * The file ID, which can be obtained by hovering your mouse over the file link * The the folder ID, which can be obtained by right" id="bs_template:@@@TPL7@@@" data-bs-name="DisableFromGlobalSearch" data-bs-type="template" data-bs-clicking on the folder link and selecting Propertiesid="7"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7"><brspan class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7">[[Image<span class="mceNonEditable template" id="bs_template:FolderID.gif|left]]@@@TPL7@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7"><brspan class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="6">The folder ID is the resourceID. For example if the URL is<prespan class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="6">http<span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="6">{{ DisableFromGlobalSearch }}</span></smart.smartsimple.orgspan></s_editresource.jsp?resourceid=67159span></span></span></span></prespan>-->the Folder ID is 67159<!--==Value Storage==<brspan class="mceNonEditable template" id="bs_template:@@@TPL8@@@" data-bs-name="ValueStoresTo" data-bs-type="template" data-bs-id="8"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name=" ValueStoresTo" data-bs-type="template" data-bs-id="7"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name=" ValueStoresTo" data-bs-type="template" data-bs-id="7"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name=" ValueStoresTo" data-bs-type="template" data-bs-id="7">{{ ValueStoresTo }}</span></span></span></span>
<span class="mceNonEditable template" id="bs_template:@@@TPL9@@@" data-bs-name=" CFPermissionsTab" data-bs-type="template" data-bs-id="9"><span class="mceNonEditable template" id="bs_template:@@@TPL8@@@" data-bs-name=" CFPermissionsTab" data-bs-type="template" data-bs-id="8"><span class="mceNonEditable template" id="bs_template:@@@TPL8@@@" data-bs-name=" CFPermissionsTab" data-bs-type="template" data-bs-id="8"><span class="mceNonEditable template" id="bs_template:@@@TPL8@@@" data-bs-name=" CFPermissionsTab" data-bs-type="template" data-bs-id="8">{{ CFPermissionsTab }}</span></span></span></span>-->
==Set Up: Creating the Field==
===Setting the Values===
Now that the Word document to be used as the template [[Adding Form Fields to a MS Word Document|has been created (step 1)]] and [[Uploading Word Merge Document to a SmartFolder|uploaded to a SmartFolder (step 2)]], you can now proceed to step 3: creating the MS Word Merge custom field that will be used to dynamically populate the document.
==* In the '''Values''' section, the form fields you created on the MS Word Merge document are now assigned by name to the associated [[SmartSimple]] FieldNames or [[Custom Field ID|Field IDs]]. The syntax is ''Mergefield ==You can now create the MS Word Merge custom @SmartSimple field name@;'' where ''Mergefield'' is a Bookmark you have assigned to a Form Field in [[SmartSimpleAdding Form Fields to a MS Word Document|step 1]] that will be used to dynamically populate the document.
: ''Examples:'': ''signatory=@me.fullname@;'':: or: ''datesigned=@#565346#@;'': [[Image:WordMerge1WordMergeValues.png|link=]]* Each ''Form Field'' on the MS Word Merge Document should be represented on a different line in the MS Word Merge Field '''Values''' section, and each line must end with a semi-colon.* The variables used for the '''MS Word Merge''' are the same as for a [[Web Page View Field]] and can be found at [[Web Page View Field Variables]].* Only fields containing text can be used for the Word Merge. Please note that you cannot use image fields, file fields etc.* [[Rich Text]] fields are not suitable for including in MS Word Merges because of the additional encoding to support formatting.* The sequence is not important, as the variables are matched using the bookmark name.** The only exception is when SmartSimple variables are merged to a Word table; the table references must be at the bottom of the list of '''Values'''. See [[Including Tables in a Word Merge Document|this page]] for instructions on configuration.* You can assign more than one field from SmartSimple into a single MS Word form field, and include other text and characters:*: ''time=@starth@:@startminute@ @startpmam@;'' would display in this format: '''"12:35 pm"''' in the time form field*:: or* ''contractdetails=@duration@ with a monthly fee of $@monthlyfee@;'' would result in '''"24 months with a monthly fee of $200"''' in the contractdetails form field* You can include ''&lt;!--hideifnotfound-->'' in front of variables that may not be present to ensure nothing is displayed, rather than the variable name.** An example would be ''monthlyfee=&lt;!--hideifnotfound-->@monthly fee@;''* You can include HTML code embedded within tags. The SmartSimple Word Merge engine will apply the HTML formatting to the value before merging to the Word document.** Note that HTML code will only function when merging to a single record, not for the [[Exporting List View Results to Microsoft Word|batch merge mode]].** Example:
The values section can be completed in two ways:<pre>bookmarkname=</pre>[#(?object=activity)#]
* The value can be assigned by name to the Form field{| style="width: 100%;"|-!|#!|Date!|Details|-| style="width: Byfirstname10%;"|~Index~| style="width: 40%;"|<!--@me.firstname@sscalculation(DATE_FORMAT("~startdate~","%d %M %Y"))-->| style="width: 10%; the Form Field value is set to the [[User"|$Activity Details$|user]]'s first name by referencing the @me.firstname@ variable.}<pre>;</pre>* The value * You can be assigned by position use the following special characters in this section to control the Form field: @#468535#@; output on the third form field value will be set custom field ID @#468535#@. '''Note'''MS Word Merge document: Field references are semi-colon delimited.*** ^p = Line break*** ^t = Tab
===Custom Field IDs===You can also add data to one or more existing tables use the Extract IDs and Display Field Names links in the resultant MS Word document if you have multiple records that you need section to includedisplay associated Field IDs and Field Names.<br />* In the example above the first table (identified by position and referenced as table_1) is set to the records associated with the [[EntityImage:Extract.PNG|entitylink=|400px]]<br />'''See [[Custom Field IDs]] for more information.'''
===Smart Folder/File ID===You must also specify the either the Field ID or File ID (as described [[Smart FolderUploading_Word_Merge_Document_to_a_SmartFolder|in the previous step]] ID where ) of the documents are located or the file IDMS Word document.<br />[[Image:FileID.PNG|link=]]
*** If you specify the [[Smart Folder]] ID , all documents in the folder will be displayed in a dropdown combo-box upon initiating the Word merge and the . The [[User|user]] can choose select the document that he/she wishes to create.***:: ''Useful if you have several different versions of a document to be generated from the same underlying data''*** If you specify the Document File ID then , that specific document will be created.* Once configured, you click used as the button associated with template for the MS Word Merge and the document will be dynamically created and the [[SmartSimple]] data added.* The document can then be saved locally. '''Note''': the [[User|user]] will need to use the MS Word Save As feature as the document will be read-onlymerge.
==Generating the Document==*** In order to generate the document when viewing or editing a record you simply click the button associated with the MS Word Merge.***: ''If a Folder ID was specified in the [[Custom Field]] settings you will be prompted to select which document should be used.''*** The document will be dynamically created and the [[SmartSimple]] data added.*** '''Note'Uploading an '': If the [[User|user]] wishes to edit or retain the document he/she may need to use the MS Word Merge document to a custom field'''Save As''' feature. Some [[Browser|browsers]] may cause it to be read only initially.*** Remember to check the size of the file, header and footer pictures may interrupt the document to merge.
Documents created in this manner are "disconnected" from ==Field Options==All common options:<br />[[Custom Fields - General Information #General_Settings|General Settings]]<br />[[Custom Fields - General Information #Role Field Permissions and Status Field Permissions|Permissions & Availability]]<br />[[Custom Fields - General Information #Classic Options|Classic Options]]<br />For further information, please refer to [[SmartSimpleCustom Fields – General Information]]. If <br /><br />Options listed below are specific to this particular field type.<br>* '''Value''' - Allows the form fields you wish to upload created on the MS Word document are now assigned by name to the associated [[SmartSimple]] you Field Names or [[Custom Field ID|Field IDs]]* '''Custom Field IDs''' - You can use one of two techniques:* Login the Extract IDs and upload Display Field Names links in the document section to display associated Field IDs and Field Names.{{ButtonLabel}} For Word Merge fields, the appropriate single or multiple file fielddefault label is "Open".* Use '''SmartFolder / File ID''' - Here you can specify the either the Field ID or File ID (as described [[SmartDoc for Microsoft Word Integration|SmartDoc]] [[Plug-InUploading_Word_Merge_Document_to_a_SmartFolder|plug-inthe previous step]] to automatically attach ) of the MS Word document to a specified single or multiple file field, without directly logging into the system.
'''SmartDoc plug-in document uploading:'''==See Also=={{WordMergeLinks}}
* To use the [[SmartDoc for Microsoft Word Integration|SmartDoc]] [[Category:Plug-In|plug-in]] to upload a Word document you need to specify the field that should be used to store the document.* The field name is set in the MS Word merge field type - [[Custom Field]] setting.* Once the document has been completed off-line, the [[User|user]] selects Upload Document in MS Word and the document will be uploaded and attached to the field.* You will need to download and install the latest version of the [[SmartDoc Ins for Microsoft Word Integration|SmartDoc]] [[Plug-In|plug-inOffice]]. [[Category:Enhancements]][[Category:Custom Fields]]{{CustomFieldPageFooter}}
Smartstaff, administrator
421
edits

Navigation menu