Incrementally Add Space Before Paragraph

  • Thread starter Becky Carter Hickman-Jones
  • Start date
B

Becky Carter Hickman-Jones

This should be so simple, but I can't seem to get it right. I can't
determine which property to use.

I would like to create a button that incrementally adds space before a
paragraph without having to go to the Format > Paragraph dialog box to
manually increase the number of points before that paragraph. I know how to
do:

Selection.ParagraphFormat.SpaceBefore = 12

but what I would like to do is make the button add the a number of points to
the existing number of points, not hard code a specific number. So if the
paragraph has 12 pts of space before, I would like add space, let's say, 6
pts at a time until I'm satisfied with the result. The button repeats the
action every time I push it. Ideally, I would like to have an option to add
space after in the same manner, and I would like to decrease the number of
points in the same manner.

I hope this is as easy I think it should be, and I hope I'm not asking too
much.

Thanks for any help,
Beck
 
G

Greg Maxey

Try:

Sub Test()
Dim i As Long
i = Selection.ParagraphFormat.SpaceBefore
Selection.ParagraphFormat.SpaceBefore = 6 + i
End Sub

If it was 12 then i will be 12 and following execution spacing will be 18.
Next time i will be 18 so spacing before will be 24.
 
B

Becky Carter Hickman-Jones

Oh, that is perfect. Thank you so much!!

Beck

Greg Maxey said:
Try:

Sub Test()
Dim i As Long
i = Selection.ParagraphFormat.SpaceBefore
Selection.ParagraphFormat.SpaceBefore = 6 + i
End Sub

If it was 12 then i will be 12 and following execution spacing will be 18.
Next time i will be 18 so spacing before will be 24.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
 

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