We’ve got a template-system here based on word-templates which are merged using aspose.words. This works just great.
Now we have a special problem. We have a part in a document (template) that contains a paragraph (without merge-fields) followed by a table (only merge-fields). During mail-merge we have to check in the database-record for a flag. If this flag is set, then the paragraph and the table have to be deleted from the resulting file. (Please note: before and after this section with the paragraph and the table there are and might be many other paragraphs, tables, sections, etc.)
How can I do this?
I know I can work with sections, but as far as I know I don’t have a possibility to name sections. So I would have to get the section by index. But what if the template-admin (just a regular MS-Word-User) makes some changes to the template (e.g. inserting new sections), then this approach leads to problems.
Any help would be highly appriciated.