P
Peter Ryckaert
I have a macro that deletes all shapes with a certain
name. Then, to all existing headers I should be able to
attach a new shape... but there I'm stuck (see last piece
of code). Can anyone help how to cycle through the
headers ?
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst,
Count:=1, Name:=""
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
' Delete all shapes with name "TMP_"
For Each oShape In Selection.HeaderFooter.Shapes
If InStr(oShape.Name, "TMP_") <> 0 Then oShape.Delete
Next oShape
' Go to first page and activate header
' --> How can I do this for ALL existing headers ?
Selection.HeaderFooter.Shapes.AddTextbox
(msoTextOrientationHorizontal, 368.85, 36#, 144#,
36#).Select
name. Then, to all existing headers I should be able to
attach a new shape... but there I'm stuck (see last piece
of code). Can anyone help how to cycle through the
headers ?
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst,
Count:=1, Name:=""
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
' Delete all shapes with name "TMP_"
For Each oShape In Selection.HeaderFooter.Shapes
If InStr(oShape.Name, "TMP_") <> 0 Then oShape.Delete
Next oShape
' Go to first page and activate header
' --> How can I do this for ALL existing headers ?
Selection.HeaderFooter.Shapes.AddTextbox
(msoTextOrientationHorizontal, 368.85, 36#, 144#,
36#).Select