I
I
Ingvar Von Bjork2018-03-17 21:58:45
C++ / C#
Ingvar Von Bjork, 2018-03-17 21:58:45

How to add empty line before table in doc file in C#?

I have a word document that contains a table. It is required to insert an empty row before this table. Tried:

Word.Range prevParagraph = tbl.Range.Previous(Word.WdUnits.wdParagraph, 1);
prevParagraph.InsertParagraphAfter();

and
Word.Range prevParagraph = tbl.Range.Previous(Word.WdUnits.wdParagraph, 1);
prevParagraph.Text += "\r\n";

but in the first case, the line was added to the first cell, and in the second, the entire previous paragraph was added to the first cell. CHADNT?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-03-17
@freeExec

That you are working with a table. Therefore, make changes to it. And it is necessary, in theory, to work with the paragraphs of the document.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question