Deleting the last paragraph in a table cell in MS Word

Viewed 17

In an empty table cell with the cursor inside, I am inserting multiple paragraphs of text (each with different styles) using insertFileFromBase64.

When no newline is present at the bottom of the Base64 DOCX file, the last paragraph will not receive the style assigned to it within the Base64 DOCX file.

However, when a newline is present within the Base64 DOCX file, I cannot get rid of it. Selecting the last paragraph within the cell and performing a delete does not return an error, but the newline remains present.

I guess this is related to the special status of the "cell marker" within Word, but I cannot find a way around this problem.

Does anyone know a solution?

1 Answers

Found workaround myself: when you FIRST set the style of the current paragraph to the style of the very last paragraph that is contained in the Base64 DOCX file, then the problem can be avoided. (Of course, this supposes that you know upfront the style of that very last paragraph -- which is not necessarily always the case.)

Related