Hi there,
I have a doc template where the there is a word “[acriticaltable]” and
“Table: Asset criticality assessment” and then replace the “[acriticaltable]” with:
It works, but after the table and before the word “Table: Asset criticality assessment” , there is a new line, although in the templated there is no that line. How to remove it?
I attach two pictures and 1 doc template and 1 doc result DISP SRA (24).docx (264.6 KB)
This option instructs Aspose.Words to remove the empty paragraph that is normally inserted after HTML that ends with a block-level element, such as table.
Paragraph para = matchedRuns.First().ParentParagraph;
// Delete matched runs
foreach (Run run in matchedRuns)
run.Remove();
if (string.IsNullOrEmpty(para.ToString(SaveFormat.Text).Trim()))
para.Remove();
After removing runs of the placeholder, the paragraph remains and you see it as empty line.