![]() |
|
#1
|
|||
|
|||
|
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
thank you dan |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
If all the list are formatted with the same style (e.g., List Paragraph) then you just need to modify the style.
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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
|
|
#7
|
|||
|
|||
|
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 |
|
|
|
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 |