[OfficeUtils] Problem inserting a page break when using Office utils

Forge Component
Published on 2017-04-26 by Elena Novozhilova
24 votes
Published on 2017-04-26 by Elena Novozhilova
Hi. I am using OfficeUtils to create Custom letters and have come across a couple of issues.The letter I am creating needed a page break between the signatory and some copyright notes.When I inserted the page break I get the errormessage 'Object Reference not set to an instance of an object'.If I remove the page break I can produce the letter.Any ideas if I can do the page break ?
There are other occasions when I get the message  'Object Reference not set to an instance of an object' and I can't find what the issue is- I can't spot any control characters in the word documents that might cause the issue is.Has anyone any useful tips for creating templates, what can and can't be done; is there a version issue with the t documents that are used as templates. Is there a way of identifying what the problem is that is causing the issue. Here's hoping someone can help Regards, Jo

Hi Joanna,

I modified the word template on "OfficeUtilsSample" by adding a page break at the end of the page content and the word file generation went fine. Can you post your problematic template here (with fake data) so that I can take a look?

Best Regards,



Hi Bruno,
Thatnks for coming back to me.I have included 2 templates one with the page break and one without the pagebreak highlighting where I want to include the page break in red.
Hi Joanna,

I tested a word file generation with the file you sent and it was successful, no errors and the output file I got seems to be exactly the same as the template, also the page break was kept.

Could be the case that you are not using the latest version of OfficeUtils?

On your previous post you mentioned that you were sending 2 templates, but I can see only one.