Hi all.
I'm trying to delete all shapes for a specific section of a word document. I've set LinkToPrevious to false for all sections and then I do the loop below. The problem is that the For loop below runs on and deletes all shapes in all sections, and that happens whether section breaks are Nextpage or Continuous types.
How can I stop the loop going beyond the end of a section?
With ActiveDocument.Sections(1)
For Each shp In .Headers(wdHeaderFooterFirstPage).Shapes
shp.Delete
Next shp
End With
I'm trying to delete all shapes for a specific section of a word document. I've set LinkToPrevious to false for all sections and then I do the loop below. The problem is that the For loop below runs on and deletes all shapes in all sections, and that happens whether section breaks are Nextpage or Continuous types.
How can I stop the loop going beyond the end of a section?
With ActiveDocument.Sections(1)
For Each shp In .Headers(wdHeaderFooterFirstPage).Shapes
shp.Delete
Next shp
End With