Difference between revisions of "Custom Field Type: Special – MS Word Merge"

From SmartWiki
Jump to: navigation, search
 
(46 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[File:PlayingCard-MSWord-Ks.jpg|thumb|150px|Click [http://www.smartsimple.com/images/customfield/cards.html here] to peruse our selection of custom fields.]]
+
__TOC__
  
This field type provides the ability to dynamically create an MS Word document from underlying [[SmartSimple]] data.  
+
==General Description==
 +
This field type provides the ability to dynamically create an MS Word document from underlying [[SmartSimple]] data.
  
The feature works as follows:
+
Configuring a Word Merge in SmartSimple is a three-step process:
* Any MS Word document can be used, up 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 create a document which includes the 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 [[SmartSimple]].
 
  
{{FieldOptions}}
+
# Create the MS Word document that will be used as the template. (See [[Adding Form Fields to a MS Word Document]] for instructions.)
{{ButtonLabel}}
+
# Upload the Word document to a [[SmartFolder]]. (See [[Uploading Word Merge Document to a SmartFolder]] for instructions.)
{{AppearMandatory}}
+
# '''This page describes how to create a Custom Field Type: Special - MS Word Merge custom field that maps the SmartSimple fields you wish to merge to the Word template.'''
{{LabelAboveField}}
 
{{HideFieldForNewRecord}}
 
  
==Adding Form Fields to a MS Word Document:==
+
<!--<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"><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></span></span>-->
===MS Word 2000-2003:===
+
<!--<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>
* From the '''View''' Menu select '''Toolbars''' and enable the '''Forms''' Toolbar
+
<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.
+
<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:@@@TPL3@@@" data-bs-name="    HideFieldForNewRecord" data-bs-type="template" data-bs-id="3"><span class="mceNonEditable template" id="bs_template:@@@TPL3@@@" data-bs-name="      HideFieldForNewRecord" data-bs-type="template" data-bs-id="3">{{      HideFieldForNewRecord }}</span></span></span></span></span></span></span>
* On the Forms Toolbar click on the first button to insert a Form Field into your document: [[Image:FormsToolbar.gif]]
 
* Right-click on the Form Field and select Properties. Then provide a name for the field in the Bookmark section.
 
  
===MS Word 2007:===
+
<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="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>
* Click on the Menu button and select '''Word Options'''
+
<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>
* In the '''Popular''' section select''Show Developer Tab in the Ribbon''
+
<span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name="DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name=" DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name="  DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7"><span class="mceNonEditable template" id="bs_template:@@@TPL7@@@" data-bs-name="  DisableFromGlobalSearch" data-bs-type="template" data-bs-id="7"><span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name="    DisableFromGlobalSearch" data-bs-type="template" data-bs-id="6"><span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name="    DisableFromGlobalSearch" data-bs-type="template" data-bs-id="6"><span class="mceNonEditable template" id="bs_template:@@@TPL6@@@" data-bs-name="      DisableFromGlobalSearch" data-bs-type="template" data-bs-id="6">{{      DisableFromGlobalSearch }}</span></span></span></span></span></span></span>-->
* Click in your Word document wherever you wish to insert a Form Field.
+
<!--==Value Storage==
* On the Developer Menu select the '''Legacy Tools''' icon which is in the Controls section: [[Image:2007Forms.gif]]
+
<span 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>
* On the Legacy Forms menu click the first icon to insert a Form Field.
 
* Right-click on the Form Field and select Properties. Then provide a name for the field in the Bookmark section.
 
  
 +
<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.
  
==Upload to SmartFolder==
+
* In the '''Values''' section, the form fields you created on the MS Word document are now assigned by name to the associated [[SmartSimple]] Field Names or [[Custom Field ID|Field IDs]]. The syntax is ''Mergefield = @SmartSimple field name@;'' where ''Mergefield'' is a Bookmark you have assigned to a Form Field in [[Adding Form Fields to a MS Word Document|step 1]].
When the document/template is ready it must be uploaded to a [[Smart Folder]]. Once it has been uploaded take note of either:
 
* The file ID, which can be obtained by hovering your mouse over the file link<br />
 
[[Image:SmartFolder-FileID.png|link=|400px]]<br />
 
''The File ID in this case is'' 97559
 
<br />-or-
 
* The folder ID, which can be obtained by hovering your mouse over the folder link (see below) or by right-clicking on the folder link and selecting Properties:<br>
 
[[Image:SmartFolder-FolderID.png|link=|700px]]
 
<br>The folder ID is the resourceID. For example, if the URL is
 
<pre>grants.smartsimplebk.us/s_editresource.jsp?resourceid=94616</pre>
 
then the Folder ID is 94616
 
<br>
 
<br>
 
<br>
 
  
==Creating the MS Word Merge Field==
+
: ''Examples:''
You can now create the MS Word Merge custom field in [[SmartSimple]] that will be used to dynamically populate the document.<br>
+
: ''signatory=@me.fullname@;''
[[Image:WordMerge1.png]]
+
:: or
* In the '''Values''' section: the form fields you created on the MS Word document are now assigned by name to the associated [[SmartSimple]] Field Names or Field IDs:
+
: ''datesigned=@#565346#@;''
::''signatory=@me.fullname@;''  
+
: [[Image:WordMergeValues.png|link=]]
:::or  
+
* 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.
::''datesigned=@#565346#@;''
+
* 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]].
* '''Note''':  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.
+
* 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 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:
 
* 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
+
*: ''time=@starth@:@startminute@ @startpmam@;'' would display in this format: '''"12:35 pm"''' in the time form field
:::or
+
*:: 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
+
* ''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.
 
* You can include ''&lt;!--hideifnotfound-->'' in front of variables that may not be present to ensure nothing is displayed, rather than the variable name.
* You can include HTML code embedded within ''<html></html>'' tags. The SmartSimple Word Merge engine will apply the HTML formatting to the value before merging to the Word document.  
+
** An example would be ''monthlyfee=&lt;!--hideifnotfound-->@monthly fee@;''
Note that HTML code will only function when merging to a single record, not for the batch merge mode.
+
* 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.
* You can use the following special characters in this section to control the output on the MS Word Merge 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]].
:* ^p  = Line break
+
** Example:
:* ^t  = Tab
+
 
 +
<pre>bookmarkname=</pre>
 +
[#(?object=activity)#]
  
'''NOTES''':  
+
{| style="width: 100%;"
* 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.
+
!|Date
 +
!|Details
 +
|-
 +
| style="width: 10%;"|~Index~
 +
| style="width: 40%;"|<!--@sscalculation(DATE_FORMAT("~startdate~","%d %M %Y"))-->
 +
| style="width: 10%;"|$Activity Details$
 +
|}
 +
<pre>;</pre>
 +
** You can use the following special characters in this section to control the output on the MS Word Merge document:
 +
*** ^p = Line break
 +
*** ^t = Tab
  
 
===Custom Field IDs===
 
===Custom Field IDs===
You can use the Extract IDs and Display Field Names links in the section to display associated Field IDs and Field Names.<br>
+
You can use the Extract IDs and Display Field Names links in the section to display associated Field IDs and Field Names.<br />
[[Image:Extract.PNG]]<br>
+
[[Image:Extract.PNG|link=|400px]]<br />
 
'''See [[Custom Field IDs]] for more information.'''
 
'''See [[Custom Field IDs]] for more information.'''
  
 
===Smart Folder/File ID===
 
===Smart Folder/File ID===
You must also specify the either the Field ID or File ID (as described [[#Upload to SmartFolder|above]]) of the MS Word document.<br>
+
You must also specify the either the Field ID or File ID (as described [[Uploading_Word_Merge_Document_to_a_SmartFolder|in the previous step]]) of the MS Word document.<br />
[[Image:FileID.PNG]]
+
[[Image:FileID.PNG|link=]]
* If you specify the Folder ID, all documents in the folder will be displayed in a combo-box upon initiating the Word merge. The [[User|user]] can 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 File ID, that specific document will be created.
 
 
 
==Including Tables==
 
You can also add data to one or more existing '''tables''' in the resultant MS Word document if you have multiple records that you need to include.
 
* In the MS Word document you must create a table with the relevant number of columns. The table should only include a single row with the column headings (the heading do '''not''' have to match the field names within SmartSimple.)
 
* You do '''not''' have to create form fields within the table. New rows will be created automatically and populated with data in the order specified in in the MS Word Merge Custom Field '''Values''' section.
 
* Tables should be included at the very end of the '''Values''' section.
 
* The table you create in MS Word for the example above would look like this:
 
[[Image:WordTable.PNG]]
 
 
 
 
 
===Using Object [#...#]  syntax===
 
* Used to pull in list of activities, contacts, users, companies, notes, associations, transactions, level-1, utaproviderL1, utaproviderL2, utaconsumerL1 or utacomsumerL2 into the Word Merge document.
 
:''For example: to include all Level 2 Activities related to a Level 1 entity you could use'':
 
table_1=[#(?object=activity)|~description~|~statusname~|~startdate~|~enddate~|$1139409$|#];
 
* Be sure there are no spaces between the pipes (|) and variables.
 
* In the example below the first table (identified by position and referenced as table_1) is set to the records associated with the [[Entity|entity]].
 
[[Image:WordMergeTable.PNG]]
 
 
 
===Using Report Property===
 
* Used to pull the contents of a specific report into the Word Merge document.
 
:''For example: to include the Custom Export formatted version (exportdata) for the Report with the ID 12345 you could use'':
 
table_1=@ReportProperty(12345,exportdata,,0)@;
 
* The Custom Export settings in the actual report must be configured so that every column in the table should have a column delimiter of "|", and that every row has a delimiter at the end "<BREAK>".
 
* Do not wrap "|" at the beginning nor the end of each row. Be sure there are no spaces between the pipes (|) and variables.
 
[[Image:ExportData.png]]
 
 
 
  
 +
*** If you specify the Folder ID, all documents in the folder will be displayed in a combo-box upon initiating the Word merge. The [[User|user]] can 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 File ID, that specific document will be used as the template for the Word merge.
  
 
==Generating the Document==
 
==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.  
+
*** 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.''
+
***: ''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.
+
*** The document will be dynamically created and the [[SmartSimple]] data added.
*'''Note''': If the [[User|user]] wishes to edit or retain the document he/she may need to use the MS Word '''Save As''' feature. Some [[Browser|browsers]] may cause it to be read only initially.
+
*** '''Note''': If the [[User|user]] wishes to edit or retain the document he/she may need to use the MS Word '''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.
+
*** Remember to check the size of the file, header and footer pictures may interrupt the document to merge.
 
 
 
 
==Uploading the MS Word Merge Document to a Custom Field==
 
The document created when you click on the MS Word Merge button is "disconnected" from [[SmartSimple]]. If you wish to upload the document to [[SmartSimple]] you can use one of two techniques:
 
* Login and upload the document to the appropriate single or multiple file field.<br />-or-
 
* Use [[SmartDoc for Microsoft Word Overview|SmartDoc for Microsoft Word]] to automatically upload the document to a specified single or multiple file field, without directly logging into the system.
 
 
 
 
 
'''SmartDoc plug-in document uploading:'''
 
 
 
Note: "Enable URL Parameter Encryption" on Global Settings must be disabled to use this.
 
 
 
* To use [[SmartDoc for Microsoft Word Overview|SmartDoc for Microsoft Word]] to upload a Word document you need to specify the field within SmartSimple that will be used to store the document. It can be either a [[Custom Field Type: Link – Single File|Single File]] or [[Custom Field Type: Link – Multiple Files|Multiple File]] field.
 
* The field name is set in the MS Word Merge Field type - [[Custom Field]] setting.
 
[[Image:StoreTo.PNG]]
 
* All [[Custom Field Type: Link – Single File|Single File]] and [[Custom Field Type: Link – Multiple Files|Multiple File]] fields on the same level and any parent levels (Level 1 and or Level 2) will be available in the '''Value Stores To''' combo box.
 
::''i.e. if the '''MS Word Merge''' field is at Level 2, you will be shown all File fields on Level 2 and Level 1.''
 
::''If all fields are being displayed rather than just file storage fields you should save the MS Word Merge [[Custom Field]].''
 
* Each user will need to download and install the latest version of [[SmartDoc for Microsoft Word Overview|SmartDoc for Microsoft Word]] to take advantage of this feature.
 
<br>
 
Once the MS Word Merge document has been generated as described [[#Generating the Document|above]] the [[user]] can edit the document and/or save it locally if desired. <br>
 
Selecting the '''Upload Document''' button on the [[SmartDoc for Microsoft Word Overview|SmartDoc]] toolbar in MS Word will cause the document to uploaded to [[SmartSimple]] and attached to the designated field.
 
 
 
==Troubleshooting==
 
'''Issue:'''
 
* Clicking the button to generate the MS Word Merge causes a browser window or tab entitled ''SmartSimple MS Word Merging'' to open, but does not open (or prompt you to open) the MS Word document.
 
'''Solution:'''
 
* Add the following to your list of "Trusted Sites" within your browser:
 
::<nowiki>http://msword.smartsimple.biz/</nowiki>
 
'''Cause:'''
 
* Depending on your browser's security settings when you generate a MS Word Merge document it will either open the document, or prompt you before opening document. If you have disabled the warning messages the browser may simply not open the file without prompting you. Adding the above URL to your trusted site list will allow it to open anyway. Alternately you can reset your browser's security settings.
 
 
 
 
 
'''Issue:'''
 
* The variable name (i.e. @variable@) is displayed on the MS Word document.
 
'''Solution:'''
 
* On the MS Word Merge field in the Values section include ''&lt;!--hideifnotfound-->'' in front of any variables that may not be present to ensure nothing is displayed, rather than the variable name.
 
'''Cause:'''
 
* If a variable is not found the ''@variablename@'' is not able to be converted to stored data, so is displayed on the MS Word Merge document exactly as written. This can happen if the associated [[Custom Field]] is on a different [[Template]] or '''Type'''.
 
 
 
  
'''Issue:'''
+
==Field Options==
* Using [[sslogic]] within an MS Word Merge custom field results in a missing custom field in the Field List View.
+
All common options:<br />
'''Solution:'''
+
[[Custom Fields - General Information #General_Settings|General Settings]]<br />
* The following syntax will resolve the issue. You must include an return/enter line at the end, as well as including a duplicate of the variable name immediately following the sslogic condition.
+
[[Custom Fields - General Information #Role Field Permissions and Status Field Permissions|Permissions & Availability]]<br />
<pre>
+
[[Custom Fields - General Information #Classic Options|Classic Options]]<br />
<!--@sslogic(',@client.categoryids@,' regexp ',1853,'>'0')-->
+
For further information, please refer to [[Custom Fields – General Information]].<br /><br />
companyName=@client.name@;
+
Options listed below are specific to this particular field type.<br>
companyName=@client.name@;
+
* '''Value''' - Allows the form fields you created on the MS Word document are now assigned by name to the associated [[SmartSimple]] Field Names or [[Custom Field ID|Field IDs]]
companyAddress=@client.address@;
+
* '''Custom Field IDs''' - You can use the Extract IDs and Display Field Names links in the section to display associated Field IDs and Field Names.
<!--@end-->
+
{{ButtonLabel}} For Word Merge fields, the default label is "Open".
<!--@sslogic(',@client.categoryids@,' regexp ',1853,'<'0')-->
+
* '''SmartFolder / File ID''' - Here you can specify the either the Field ID or File ID (as described [[Uploading_Word_Merge_Document_to_a_SmartFolder|in the previous step]]) of the MS Word document.
companyName=@client.parent.name@;
 
companyName=@client.parent.name@;
 
companyAddress=@client.parent.address@;
 
<!--@end-->
 
<newline at the end>
 
</pre>
 
  
 
==See Also==
 
==See Also==
* [[Including Check Boxes on an MS Word Merge Document]]
+
{{WordMergeLinks}}
* [[Including XML on an MS Word Merge Document]]
 
* [[Exporting List View Results to Microsoft Word]]
 
  
[[Category:Plug-Ins for Microsoft Office]][[Category:Integration]]
+
[[Category:Plug-Ins for Microsoft Office]]
 
{{CustomFieldPageFooter}}
 
{{CustomFieldPageFooter}}

Latest revision as of 14:14, 4 December 2018

General Description

This field type provides the ability to dynamically create an MS Word document from underlying SmartSimple data.

Configuring a Word Merge in SmartSimple is a three-step process:

  1. Create the MS Word document that will be used as the template. (See Adding Form Fields to a MS Word Document for instructions.)
  2. Upload the Word document to a SmartFolder. (See Uploading Word Merge Document to a SmartFolder for instructions.)
  3. This page describes how to create a Custom Field Type: Special - MS Word Merge custom field that maps the SmartSimple fields you wish to merge to the Word template.

Set Up: Creating the Field

Setting the Values

Now that the Word document to be used as the template has been created (step 1) and 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 document are now assigned by name to the associated SmartSimple Field Names or Field IDs. The syntax is Mergefield = @SmartSimple field name@; where Mergefield is a Bookmark you have assigned to a Form Field in step 1.
Examples:
signatory=@me.fullname@;
or
datesigned=@#565346#@;
WordMergeValues.png
  • 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 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 <!--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=<!--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 batch merge mode.
    • Example:
bookmarkname=

[#(?object=activity)#]

# Date Details
~Index~ $Activity Details$
;
    • You can use the following special characters in this section to control the output on the MS Word Merge document:
      • ^p = Line break
      • ^t = Tab

Custom Field IDs

You can use the Extract IDs and Display Field Names links in the section to display associated Field IDs and Field Names.
Extract.PNG
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 in the previous step) of the MS Word document.
FileID.PNG

      • If you specify the Folder ID, all documents in the folder will be displayed in a combo-box upon initiating the Word merge. The user can 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 File ID, that specific document will be used as the template for the Word merge.

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: If the user wishes to edit or retain the document he/she may need to use the MS Word Save As feature. Some 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.

Field Options

All common options:
General Settings
Permissions & Availability
Classic Options
For further information, please refer to Custom Fields – General Information.

Options listed below are specific to this particular field type.

  • Value - Allows the form fields you created on the MS Word document are now assigned by name to the associated SmartSimple Field Names or Field IDs
  • Custom Field IDs - You can use the Extract IDs and Display Field Names links in the section to display associated Field IDs and Field Names.
  • Button Label: Text to be displayed on the field's button. If no text is entered, the system will use a default label. For Word Merge fields, the default label is "Open".
  • SmartFolder / File ID - Here you can specify the either the Field ID or File ID (as described in the previous step) of the MS Word document.

See Also

To set up a Word merge:

Advanced Word Merge Features Include: