Chapter 21: Troubleshooting

The following table lists some known issues with M2Doc.

Table 21.1: M2Doc Troubleshooting

ProblemDescription
A basic M2Doc field does not seem to workSometimes an M2Doc variable is entered as text instead of as a field. Toggle Alt-F9. If your field does not appear and disappear, it is probably text. Remember to use Ctrl-F9 to insert an M2Doc field. Note that you insert M2Doc variables directly into Microsoft Word. You do not need a plug-in.
Fields become unusableUnder certain circumstances, existing fields in the template stop working. As a solution, the recommendation is to not update fields if prompted to do so when opening a generated report file.
Corrupted Microsoft Word file when the same diagram is added multiple timesUsing .asImage() to insert the same medini diagram more than once results in a corrupted Microsoft Word document. Make sure you only insert the diagram once.
Non-M2Doc fields replaced with regular textCertain non-M2Doc fields in the Microsoft Word document are replaced with regular text. If possible, avoid using non-M2Doc fields in the M2Doc template.

As a workaround, adding a backslash at the end of the code seems to prevent the code from being converted to plain text. See the following example of a Microsoft Word figure caption with added backslash:

{SEQ Figure \ * ARABIC \}