![]() |
|
|
|
#1
|
|||
|
|||
|
So that would be the "next" paragraph:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim oRng As Range
For Each oPar In ActiveDocument.Paragraphs
Select Case oPar.Style
Case "Heading 1", "Heading 2", "Heading 3" 'etc.
Set oRng = oPar.Next.Range
oRng.End = oRng.End - 1
oRng.Text = "Start " & oRng.Text & " End"
End Select
Next oPar
lbl_Exit:
Exit Sub
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Automatic locking section of document AFTER text typed
|
lou1990lou | Word VBA | 2 | 01-20-2019 02:39 PM |
Auto section break macro - want to have no header on first page of document
|
cspeid03 | Word | 1 | 05-17-2017 12:18 PM |
Wrap text in text box around image with transparent background
|
pstidsen | Word | 4 | 02-08-2016 03:30 PM |
Fix a section on first page and wrap around it?
|
Bpilgrim | Word | 2 | 09-04-2015 09:50 PM |
Macro to insert multiple pictures to word to a specific size and text wrap
|
mescaL | Word VBA | 3 | 11-03-2014 10:51 PM |