Hello Community,

I’ve seen quite a few cases come in regarding page numbering. The most common issue is ‘! Syntax Error, !/Syntax Error, !’

                                              

Page numbering is driven from the bookmarks within the Microsoft Dynamics GP Word Template. If you are unfamiliar with what bookmarks are and how Microsoft Dynamics GP utilizes them with Word Templates, check out my blog on this:

What are bookmarks and how are they used in Microsoft Dynamics GP's Word Templates?
https://community.dynamics.com/gp/b/dynamicsgp/posts/what-are-bookmarks-and-how-are-they-used-in-microsoft-dynamics-gp-s-word-templates

Specifically bookmarks StartTemplateDocumentBookmark and EndTemplateDocumentBookmark are what drive the page numbering.

So, when these cases come in the first thing, I like to do is verify that these two bookmarks are included within the Word Template.

  1. In the Reports menu, select Template Maintenance.
  2. Click Modify on the Word Template with the page numbering problem.                                 
    In Microsoft Word, click into any of the tables that contain data on the template, go to the Insert menu, Links section, select Bookmark.
  3. As you can see in my screenshot, I am missing the StartTemplateDocumentBookmark and EndTemplateDocumentBookmark.
                             
                         

When adding bookmarks to Word Templates, I like to first makes sure they are visible on the Microsoft Word Document and have my text boards visible.

  1. In Microsoft Word, File menu, Advanced tab, Show document content section.
  2. Check the box next to option “Show bookmarks”
  3. Check the box next to option “Show text boundaries”

                    



  4. Now the Word Template looks like the following:


      


  5. I use the following screenshot to help determine where the bookmarks need to be placed:

    StartTemplateDocumentBookmark | This bookmark is located within the first table of the report template document. It defines where the start of the report template document is located.

    EndTemplateDocumentBookmark | This bookmark is located within the last table of the report template document. It defines where the end of the report template document is located.





  6. To add the bookmark, you need to put the cursor within the document where you want the bookmark.
  7. As shown above, my cursor is in the middle of a content-controlled field. This is not where you want a bookmark. Bookmarks must not be located within the fields, captions, or legends used for the report. So, I’ll use my left arrow to move the cursor outside this field but remain in the table

    It’s hard to tell in a screenshot, but I highlighted where my cursor is.
      



  8. Now you need to go into the Insert Menu, Links and Bookmark
  9. Enter the following “StartTemplateDocumentBookmark” and click add
  10. You should see a bookmark on the Word document… and you can see the first Syntax Error has been replaced with 1.



  11. Add the EndTemplateDocumentBookmark.
  12. The bookmark and the second Syntax Error is replaced to a 1, so now the document shows 1/1.
  13. Choose Save As the document and re-add it back to Microsoft Dynamics GP.
  14. When Save As make sure you leave the checkbox ‘Maintain compatibility with previous versions of Word’ checked.
  15. To add the template back into GP, go Microsoft Dynamics GP >> Reports >> Template Maintenance.
  16. Select the specific report from the Reports drop down menu and click the green plus sign.
  17. Locate the document you saved and click OK.
  18. Click Yes to ‘The template you are adding already exists in the database. Would you like to replace the existing template?’
  19. Test printing your document.

Hopefully like myself your document is now printing the correct page numbering.

Well my fellow Word Template advocates, that concludes this blog. I hope you can use this in your future Word Template cases. As always, if you have anything, you’d like to see blogged around leave me a comment. I’d love to help.

Until next time,
Nicole Fiskum | Support Engineer | Microsoft Dynamics