Apply "Space Before 18 pt" on all the paragraph immediately followingtables

A

andreas

Dear Experts,

I would like to achieve the following using Word VBA:

I would like to apply an "18 pt space before" to the paragraph
immediately following a table.

For example:

Table cell Table cell Table cell
Table cell Table cell Table cell
Table cell Table cell Table cell
Paragraph immediately following the table (spacing before: 18 pt)

The macro should loop through the document and apply this to all
occurrences.

Help is much appreciated. Thank you very much in advance. Regards,
Andreas
 
D

Doug Robbins - Word MVP

Use

Dim atable As Table
Dim arange As Range
For Each atable In ActiveDocument.Tables
Set arange = atable.Range
arange.Collapse wdCollapseEnd
arange.ParagraphFormat.SpaceBefore = 18
Next atable


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

andreas

Use

Dim atable As Table
Dim arange As Range
For Each atable In ActiveDocument.Tables
    Set arange = atable.Range
    arange.Collapse wdCollapseEnd
    arange.ParagraphFormat.SpaceBefore = 18
Next atable

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP












- Zitierten Text anzeigen -

Dear Doug,

great. It works fine. thank you very much for your kind help. Regards,
Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top