Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Mon, 21 Apr 2008 20:40:01 -0700,    group: microsoft.public.word.vba.customization        back       


how to delete images inside the header of sections   
Hi All,

I want to delete images inside the header of all sections except section 1 
by using VBA code

please help.

Thanks

Nick
date: Mon, 21 Apr 2008 20:40:01 -0700   author:   Nick

Re: how to delete images inside the header of sections   
Untested, but the following should do what you want:

Dim i As Long, j As Long
With ActiveDocument
    For i = 2 To .Sections.Count
        With .Sections(i).Headers(wdHeaderFooterFirstPage).Range
            For j = .InlineShapes.Count To 1 Step -1
                .InlineShapes(j).Delete
            Next j
        End With
        With .Sections(i).Headers(wdHeaderFooterPrimary).Range
            For j = .InlineShapes.Count To 1 Step -1
                .InlineShapes(j).Delete
            Next j
        End With
    Next i
End With


-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Nick"  wrote in message 
news:FC0A7FE2-E1AD-4F4D-80A0-C1E18EC917F0@microsoft.com...
> Hi All,
>
> I want to delete images inside the header of all sections except section 1
> by using VBA code
>
> please help.
>
> Thanks
>
> Nick
date: Tue, 22 Apr 2008 19:18:11 +1000   author:   Doug Robbins - Word MVP

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us