Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2016, 08:16 AM
dan88 dan88 is offline Insert Paragraph after each list item  - All Lists Windows 10 Insert Paragraph after each list item  - All Lists Office 2016
Novice
Insert Paragraph after each list item  - All Lists
 
Join Date: Feb 2016
Posts: 24
dan88 is on a distinguished road
Default Insert Paragraph after each list item - All Lists

Hi all,



I have lots of lists in the document that need to be formatted a certian way - they need to have a paragraph inserted after it.

I would like to do this for all my lists

Here is example attachement image


i have started basic idea

Code:
Sub SpaceLists()

Dim oPara As Word.Paragraph

 For Each oPara In ActiveDocument.Paragraphs
        If oPara.Range.ListFormat.ListType = wdListBullet Then
        
        oPara.Next.Range.InsertAfter = normalPara
        
        

End Sub
am i on the right track?

thank you

dan
Attached Images
File Type: png Image.png (22.6 KB, 20 views)
Reply With Quote
  #2  
Old 05-07-2016, 08:50 AM
gmaxey gmaxey is offline Insert Paragraph after each list item  - All Lists Windows 7 32bit Insert Paragraph after each list item  - All Lists Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Why don't you simply modify the list paragraph style to include a certain amount of space after.

Empty paragraphs are not the way to format text.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 05-07-2016, 10:36 AM
dan88 dan88 is offline Insert Paragraph after each list item  - All Lists Windows 10 Insert Paragraph after each list item  - All Lists Office 2016
Novice
Insert Paragraph after each list item  - All Lists
 
Join Date: Feb 2016
Posts: 24
dan88 is on a distinguished road
Default

Hello Greg,

After a while i was able to locate the missing option to space out the paragraph.

Right Click >> Paragraph > Spacing > Uncheck don't add space of same style

But in case if i wanted to do that to all lists i would still have to loop through the lists right.

Alright let me see if i can put some thing together again

dan
Reply With Quote
  #4  
Old 05-07-2016, 10:49 AM
gmaxey gmaxey is offline Insert Paragraph after each list item  - All Lists Windows 7 32bit Insert Paragraph after each list item  - All Lists Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

If all the list are formatted with the same style (e.g., List Paragraph) then you just need to modify the style.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #5  
Old 05-07-2016, 12:12 PM
dan88 dan88 is offline Insert Paragraph after each list item  - All Lists Windows 10 Insert Paragraph after each list item  - All Lists Office 2016
Novice
Insert Paragraph after each list item  - All Lists
 
Join Date: Feb 2016
Posts: 24
dan88 is on a distinguished road
Default

Hi Greg,

I should have probably explained my post better.
I am trying to insert the empty paragraph as later it is where i have text to copy into.

Please see attachement.

There is a huge gap between the list item title and description

I'm not sure how to solve this problem now

thanks

dan
Attached Images
File Type: png image2.png (6.3 KB, 17 views)
Reply With Quote
  #6  
Old 05-07-2016, 01:23 PM
gmaxey gmaxey is offline Insert Paragraph after each list item  - All Lists Windows 7 32bit Insert Paragraph after each list item  - All Lists Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

You might hit and error or have to do a little cleanup but try:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim oParNew As Paragraph
  For Each oPar In ActiveDocument.Paragraphs
    If oPar.Range.ListFormat.ListType = 3 Then
      oPar.Next.Range.Select
      If oPar.Next.Range.ListFormat.ListType = 3 Then
        oPar.Range.InsertAfter vbCr
        Set oParNew = oPar.Next
        oParNew.Style = "Normal"
      End If
    End If
  Next
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #7  
Old 05-07-2016, 05:13 PM
dan88 dan88 is offline Insert Paragraph after each list item  - All Lists Windows 10 Insert Paragraph after each list item  - All Lists Office 2016
Novice
Insert Paragraph after each list item  - All Lists
 
Join Date: Feb 2016
Posts: 24
dan88 is on a distinguished road
Default

Hi Greg,

no this is great!

It inserts a paragraph space ready for me to paste text into -

thanks alot for your code.

Cheers

dan
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding another item to the end of an existing list cdrdash Word 2 01-28-2015 09:53 AM
insert linked item in email userman Outlook 0 06-14-2012 12:27 AM
Multilevel lists and paragraph indentation computerdummy Word 2 04-27-2012 02:32 PM
Insert an item to excel specific cell apjneeraj Excel 0 01-18-2011 03:39 AM
Referens to an item list... matbli Word 0 10-29-2009 08:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft