J
James Pannozzi
I had no trouble using VBA to add a bitmap picture to a
header with ...Shapes.AddPicture "SomeFile" False, True, 8, 5, 380, 90
But I can't figure out how you use VBA to delete a picture from the header.
I've tried this (from Helmut)
but it has absolutely no effect.
Dim oSct As Section
Dim oHdr As HeaderFooter
Dim oDcm As Document
Dim oShp As Shape
Set oDcm = ActiveDocument
For Each oSct In oDcm.Sections
For Each oHdr In oSct.Headers
For Each oShp In oHdr.Shapes
oHdr.Range.InlineShapes(1).Delete
Next
Next
Next
Next I tried this:
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Range.ShapeRange
(1).Delete
but I get an error message 5941 about something not being in its collection
How exactly do you use VBA to delete a picture from a
header??????????????????
Thanks
Jim
header with ...Shapes.AddPicture "SomeFile" False, True, 8, 5, 380, 90
But I can't figure out how you use VBA to delete a picture from the header.
I've tried this (from Helmut)
but it has absolutely no effect.
Dim oSct As Section
Dim oHdr As HeaderFooter
Dim oDcm As Document
Dim oShp As Shape
Set oDcm = ActiveDocument
For Each oSct In oDcm.Sections
For Each oHdr In oSct.Headers
For Each oShp In oHdr.Shapes
oHdr.Range.InlineShapes(1).Delete
Next
Next
Next
Next I tried this:
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Range.ShapeRange
(1).Delete
but I get an error message 5941 about something not being in its collection
How exactly do you use VBA to delete a picture from a
header??????????????????
Thanks
Jim