Insert snippet scripts
When inserting snippet scripts, there is a special feature that must be taken into account. This comes into play especially when the snippet script is applied with update="true"
, but should always be applied this way:
<CustomDataNode id="ExampleSnippetScript" update="true">
<Condition when="RedCircle = 'true'">
<Snippet id="05da9095-de60-4b78-bcd8-692639e8d377" />
</Condition>
<Condition notwhen="RedCircle = 'true' | BlueCircle = 'false'">
<Snippet id="5bc2d759-431f-41e0-a18c-d577b240e612" />
</Condition>
</CustomDataNode>
When updating snippet scripts, it may happen that the document content is not updated. In the log of the OneOffixx Word add-in the error message InsertSnippet-Loop for 'SnippetId' and error-message: System.Runtime.InteropServices.COMException (0x80004005)
is displayed.
Note
If there is a table at the end of a document, it can lead to errors when updating the snippet script. To prevent this, care must be taken with how the snippet script is inserted in the content template.
Correct insertion in Word/Outlook
For inserting the snippet script in the content template, with the assurance that there are no problems with tables at the end of the document, there are three different options:
Option 1: Empty paragraph after the snippet script
Option 2: Non-breaking space (ctrl+shift+space) after snippet script
Tip
With options 1 and 2, an additional line break is inserted after the snippet script. This can be undesirable depending on the situation. Option 1 can be extended so that there is no (visible) line break after the snippet script.
Option 3: Empty paragraph after snippet script – formatted with style "InvisibleLine"
The style InvisibleLine is included by default in every client solution and can be used directly. InvisibleLine reduces the paragraph to a non-visible size. If this option is used, then the additional paragraph is still present after the snippet script, but is so small that it is not visible and does not take up space.