Remove Spacing Between Paragraphs in Address Blocks

When you stack short lines like an address block, IronWord's default paragraph spacing leaves a visible gap between each line. To close that gap, set a fixed line-spacing value on every paragraph so each line gets a fixed height with no extra padding. Verified on IronWord 2026.4.1.

Solution

1. Create the Document and List the Lines

Start a new WordDocument and collect the lines you want stacked together.

WordDocument doc = new WordDocument();
string[] addressLines =
{
   "Max Mustermann",
   "Musterstraße 42",
   "12345 Musterstadt",
   "Deutschland"
};
WordDocument doc = new WordDocument();
string[] addressLines =
{
   "Max Mustermann",
   "Musterstraße 42",
   "12345 Musterstadt",
   "Deutschland"
};
Dim doc As New WordDocument()
Dim addressLines As String() = {
    "Max Mustermann",
    "Musterstraße 42",
    "12345 Musterstadt",
    "Deutschland"
}
$vbLabelText   $csharpLabel

2. Apply a Fixed Line-Spacing Value to Each Paragraph

For each line, build a Paragraph and set its SpacingBetweenLines property to a fixed value. This gives every line a consistent height and removes the inter-line gap.

foreach (string line in addressLines)
{
    Paragraph para = new Paragraph(new TextContent(line));
    para.SpacingBetweenLines = 210;
    doc.AddParagraph(para);
}
foreach (string line in addressLines)
{
    Paragraph para = new Paragraph(new TextContent(line));
    para.SpacingBetweenLines = 210;
    doc.AddParagraph(para);
}
For Each line As String In addressLines
    Dim para As New Paragraph(New TextContent(line))
    para.SpacingBetweenLines = 210
    doc.AddParagraph(para)
Next
$vbLabelText   $csharpLabel

3. Save the Document

doc.SaveAs("address3.docx");
doc.SaveAs("address3.docx");
doc.SaveAs("address3.docx")
$vbLabelText   $csharpLabel

Address block with tight line spacing between paragraphs

Debug Tips

  • Do not use ParagraphSpacing: the class is not available in 2026.4.1.
  • Avoid zeroing SpacingBefore and SpacingAfter: set SpacingBetweenLines to a fixed value instead, as shown above, for predictable results.

WarningPrefer setting SpacingBetweenLines to a fixed value over zeroing SpacingBefore and SpacingAfter, as shown above, for reliable paragraph spacing.

For more on placing text, see the Add Text how-to.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 49,216 | Version: 2026.7 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronWord
run a sample watch your data become a Word doc.