How to create tab stops using Novacode-Docx library?

401 views Asked by At

I am trying to achieve something like this: enter image description here

Using String.Format("{0, -80}", "User Representative" + "Date")doesn't work because symbols of word document have different sizes.

Best way to implement this would be using tab stops. My question is is it possible to create tab stops using Novacode-Docx library. If not are there any other ways to implement this ?

1

There are 1 answers

1
Evaldas B On BEST ANSWER

I found simple workaround. You need to create fields in your .docx named something like this: %FieldExample%

After that it is very easy to replace these fields with your text:

                document.ReplaceText("%Date1%", YourDate1);
                document.ReplaceText("%Date2%", YourDate2);

                document.ReplaceText("%Occupation1%", YourOccupation1);
                document.ReplaceText("%Occupation2%", YourOccupation2);