Je veux supprimer et ajouter une forme existante dans Word (en-tête et pied de page) avec un boutonsupprimer et ajouter des formes dans Word
Mais je ne peux pas choisir la forme pour modifier la propriété visible.
Comment est-ce que je peux faire ceci? Je ne peux pas comprendre le nom de la forme dans le mot
Merci pour votre aide!
Sub LogoChangeVisible()
'
' Removes and adds the logo from Header and Footer
'
'
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes("Picture from Header").Select
If Selection.ShapeRange.Visible = msoTrue Then
Selection.ShapeRange.Visible = msoFalse
Selection.HeaderFooter.Shapes("Picture from Footer").Select
Selection.ShapeRange.Visible = msoFalse
ElseIf Selection.ShapeRange.Visible = msoFalse Then
Selection.ShapeRange.Visible = msoTrue
Selection.HeaderFooter.Shapes("Picture from Footer").Select
Selection.ShapeRange.Visible = msoTrue
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
Il n'a trouvé aucune forme. Est-ce que ça compte comme une forme si c'est une image jpg? –
Oui, ça compte comme une forme, mais ça peut aussi être une forme en ligne. Essayez ceci: Debug.Print ActiveDocument.Sections (1) .Headers (wdHeaderFooterPrimary) .Range.InlineShapes.Count – Sam