From: Andrew . on
Hi All,

I have a program that merges a text file with my own delimiters into a
blank word document.

I create a table an insert a number of rows.

Recently I have notice the paragraph spacing in the cells is now set
to 0pt before and 10pt after.

Can someone help me set the after spacing to 0pt, either per cell or
for the table as a whole or even for the entire document. I have
tried a number of commands but I can't seem to get it.

Regards,
Andrew.
From: Pesach Shelnitz on
Hi Andrew,

Although the more efficient way to control the paragraph spacing is to
define a paragraph style with the desiried spacing and apply it to your
paragraphs, you can use the following macro to set the space after the
paragraphs in all your tables to 0.

Sub SetSpaceAfterToZero()
Dim i As Long

With ActiveDocument
For i = 1 To .Tables.Count
.Tables(i).Range.ParagraphFormat.SpaceAfter = 0
Next
End With
End Sub

--
Hope this helps,
Pesach Shelnitz
My Web site: http://makeofficework.com


"Andrew ." wrote:

> Hi All,
>
> I have a program that merges a text file with my own delimiters into a
> blank word document.
>
> I create a table an insert a number of rows.
>
> Recently I have notice the paragraph spacing in the cells is now set
> to 0pt before and 10pt after.
>
> Can someone help me set the after spacing to 0pt, either per cell or
> for the table as a whole or even for the entire document. I have
> tried a number of commands but I can't seem to get it.
>
> Regards,
> Andrew.
> .
>
From: Andrew . on
On Dec 21, 3:33 am, Pesach Shelnitz <pesach18(AT)hotmail.com> wrote:
> Hi Andrew,
>
> Although the more efficient way to control the paragraph spacing is to
> define a paragraph style with the desiried spacing and apply it to your
> paragraphs, you can use the following macro to set the space after the
> paragraphs in all your tables to 0.
>
> Sub SetSpaceAfterToZero()
>     Dim i As Long
>
>     With ActiveDocument
>         For i = 1 To .Tables.Count
>             .Tables(i).Range.ParagraphFormat.SpaceAfter = 0
>         Next
>     End With
> End Sub
>
> --
> Hope this helps,
> Pesach Shelnitz
> My Web site:http://makeofficework.com
>

Thanks Pesach. Worked well.

I also discovered the first paragraph needed a little help too and the
following worked.
ActiveDocument.Paragraphs(1).Range.ParagraphFormat.SpaceAfter = 0

I like your website - great links to other reference sites.

Thanks again.
Andrew.