View Single Post
 
Old 11-14-2023, 02:35 PM
Jetheat Jetheat is offline Mac OS X Office 2016 for Mac
Novice
 
Join Date: Dec 2013
Posts: 21
Jetheat is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oSection As Section
Dim oRng As Range
Dim lngIndex As Long, lngShape As Long
 For Each oSection In ActiveDocument.Sections
   For lngIndex = 1 To 3
     For lngShape = oSection.Headers(lngIndex).Range.ShapeRange.Count To 1 Step -1
       oSection.Headers(lngIndex).Range.ShapeRange(lngShape).Delete
     Next
    Next
  Next
lbl_Exit:
  Exit Sub
End Sub
Thanks a lot for the effort.

It now works by leaving the line in the footer, but it still removes the shape from around Page 1.

In fact, my real document has additional pages (attached), so is there a way to remove the shape from certain types of pages and to leave it on others?

Have a look at the attached doc.

JH
Attached Files
File Type: docx Header Change 2.docx (351.0 KB, 5 views)
Reply With Quote