![]() |
|
#14
|
||||
|
||||
|
Try it this way:
Code:
Sub GetAndRemoveSectionByInstanceNumber()
Dim ScnBrk As Long
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Inst#: " & ReportInstance
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute
End With
If .Find.Found = True Then
With .Duplicate
ScnBrk = .Sections(1).PageSetup.SectionStart
.Sections(1).Range.Delete
.Sections(1).PageSetup.SectionStart = ScnBrk
End With
End If
End With
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Deleting section break and retaining section properties
|
New Daddy | Word | 6 | 02-03-2014 07:09 PM |
Section Break (Next Page) replaces Section Break (Continuous) when deleted
|
Carlabasson | Word | 2 | 03-25-2013 10:13 PM |
| Continuous section break and column changes | Jim B | Word | 3 | 11-27-2012 02:25 PM |
| why the "section break-next page" is switched to "section break-continuous"? | Jamal NUMAN | Word | 6 | 12-14-2011 03:35 PM |
Section Break Continuous: doesn't affect the format of the page numbering
|
Jamal NUMAN | Word | 2 | 06-22-2011 04:46 PM |