Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 07-08-2022, 06:14 AM
macropod's Avatar
macropod macropod is offline Bulk Removal of Paragraph Mark in Header Windows 10 Bulk Removal of Paragraph Mark in Header Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could just change:
FindText:="[^13]{3,}"
to:
FindText:="[^13]{2,}"
and leave:
ReplaceWith:="^p^p"
alone.

Alternatively, you might modify the Dim line at the top of the UpdateDocuments sub, thus:
Code:
Dim strInFolder As String, strFile As String, Sctn As Section, HdFt As HeaderFooter, Rng As Range
and change:
Code:
        With HdFt
          If .Exists Then .Range.Find.Execute FindText:="[^13]{3,}", ReplaceWith:="^p^p", MatchWildcards:=True, Replace:=wdReplaceAll
        End With
to:
Code:
        With HdFt
          If .Exists Then
            Set Rng = .Range.Characters.Last
            With Rng
              Do While .Start > HdFt.Range.Start
                If .Characters.First.Previous = vbCr Then
                  .Start = .Start - 1
                Else
                  Exit Do
                End If
              Loop
              If .Paragraphs.Count > 2 Then .Text = vbCr & vbCr
            End With
          End If
        End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
a macro to replace paragraph mark with a space applies effect on paragraph marks after the selection drrr Word VBA 2 08-24-2021 03:05 AM
Bulk Removal of Paragraph Mark in Header What is this paragraph mark called booneyrex Word 8 03-04-2021 04:15 AM
Bulk Removal of Paragraph Mark in Header Indention below paragraph mark... kikola Word VBA 13 05-26-2020 06:21 AM
Bulk Removal of Paragraph Mark in Header Please help with header and footer removal pwangdel Word 3 11-03-2011 06:10 AM
Bulk Removal of Paragraph Mark in Header Final paragraph mark Caroline Word 2 02-22-2011 10:39 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:38 PM.


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