Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Incrementally Add Space Before Paragraph

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Becky Carter Hickman-Jones - 29 Oct 2005 00:09 GMT
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
Greg Maxey - 29 Oct 2005 00:32 GMT
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.

Signature

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

> This should be so simple, but I can't seem to get it right. I can't
> determine which property to use.
[quoted text clipped - 19 lines]
> Thanks for any help,
> Beck
Becky Carter Hickman-Jones - 03 Nov 2005 04:01 GMT
Oh, that is perfect. Thank you so much!!

Beck

> Try:
>
[quoted text clipped - 30 lines]
> > Thanks for any help,
> > Beck

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.