Entete-pied de page seulement sur 1ère page
amour076
-
raph0351 Messages postés 397 Statut Membre -
raph0351 Messages postés 397 Statut Membre -
Bonjour,
j'aimerais mettre mon entete et pied de page seulement sur la première page en vba word
pouvez-vous m'aider svp?
merci d'avance
j'ai déjà fait un code :
Sub entete_pied()
'
' entete_pied Macro
'
'
Dim objShape As InlineShape
'en-tete de page
'emplacement du logo
Set objShape = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InlineShapes.AddPicture(FileName:="F:\GESDOC\PROMOTIONS_COMMERCIALES_ET_COMMUNICATION\IMADOC\LOGO CENTRE DE DOC\LOGO CDD coulombr1.jpg", LinkToFile:=False, SaveWithDocument:=True)
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
.ParagraphFormat.Alignment = wdAlignParagraphCenter 'centre le logo de l'entete
End With
With objShape
.LockAspectRatio = msoTrue
.Height = .Height * 0.37 'redimensionne le logo entete
.Width = .Width * 0.37 'redimensionne le logo entete
End With
'pied de page
Selection.Font.Underline = wdUnderlineWavy 'saut de ligne
'texte
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "" & Chr(13) + Chr(10) & "PALAIS DES CONSULS - QUAI DE LA BOURSE - BP 641 - 76007 ROUEN CEDEX 13" & Chr(13) + Chr(10) & "Tél. 02 35 14 37 60 - Télécopie 02 35 14 38 31" & Chr(13) + Chr(10) & "cdedoc@rouen.cci.fr - www.rouen.cci.fr/cdedoc"
With ActiveDocument.StoryRanges(wdPrimaryFooterStory)
.Bold = False
.ParagraphFormat.Alignment = wdAlignParagraphCenter 'centre le texte
.Font.Size = 6.5 'redimensionne le texte
.Font.Color = RGB(96, 53, 107) ' coloration du texte
End With
'emplacement du logo
Set objShape = ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.InlineShapes.AddPicture(FileName:="F:\GESDOC\PROMOTIONS_COMMERCIALES_ET_COMMUNICATION\IMADOC\logo_ccir.jpg", LinkToFile:=False, SaveWithDocument:=True)
With objShape
.LockAspectRatio = msoTrue
.Height = .Height * 0.11 'redimensionne le logo pied de page
.Width = .Width * 0.13 'redimensionne le logo pied de page
End With
With ActiveDocument.Sections(1)
'Pied de page de toutes les pages
With .Footers(wdHeaderFooterPrimary).Range
'Réaliser un trait
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle 'bordure simple
.Color = RGB(184, 172, 70) 'coloration de la bordure
End With
End With
End With
End Sub
j'aimerais mettre mon entete et pied de page seulement sur la première page en vba word
pouvez-vous m'aider svp?
merci d'avance
j'ai déjà fait un code :
Sub entete_pied()
'
' entete_pied Macro
'
'
Dim objShape As InlineShape
'en-tete de page
'emplacement du logo
Set objShape = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InlineShapes.AddPicture(FileName:="F:\GESDOC\PROMOTIONS_COMMERCIALES_ET_COMMUNICATION\IMADOC\LOGO CENTRE DE DOC\LOGO CDD coulombr1.jpg", LinkToFile:=False, SaveWithDocument:=True)
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
.ParagraphFormat.Alignment = wdAlignParagraphCenter 'centre le logo de l'entete
End With
With objShape
.LockAspectRatio = msoTrue
.Height = .Height * 0.37 'redimensionne le logo entete
.Width = .Width * 0.37 'redimensionne le logo entete
End With
'pied de page
Selection.Font.Underline = wdUnderlineWavy 'saut de ligne
'texte
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "" & Chr(13) + Chr(10) & "PALAIS DES CONSULS - QUAI DE LA BOURSE - BP 641 - 76007 ROUEN CEDEX 13" & Chr(13) + Chr(10) & "Tél. 02 35 14 37 60 - Télécopie 02 35 14 38 31" & Chr(13) + Chr(10) & "cdedoc@rouen.cci.fr - www.rouen.cci.fr/cdedoc"
With ActiveDocument.StoryRanges(wdPrimaryFooterStory)
.Bold = False
.ParagraphFormat.Alignment = wdAlignParagraphCenter 'centre le texte
.Font.Size = 6.5 'redimensionne le texte
.Font.Color = RGB(96, 53, 107) ' coloration du texte
End With
'emplacement du logo
Set objShape = ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.InlineShapes.AddPicture(FileName:="F:\GESDOC\PROMOTIONS_COMMERCIALES_ET_COMMUNICATION\IMADOC\logo_ccir.jpg", LinkToFile:=False, SaveWithDocument:=True)
With objShape
.LockAspectRatio = msoTrue
.Height = .Height * 0.11 'redimensionne le logo pied de page
.Width = .Width * 0.13 'redimensionne le logo pied de page
End With
With ActiveDocument.Sections(1)
'Pied de page de toutes les pages
With .Footers(wdHeaderFooterPrimary).Range
'Réaliser un trait
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle 'bordure simple
.Color = RGB(184, 172, 70) 'coloration de la bordure
End With
End With
End With
End Sub
A voir également:
- Entete-pied de page seulement sur 1ère page
- Comment supprimer une page sur word - Guide
- Comment imprimer un tableau excel sur une seule page - Guide
- Page d'accueil - Guide
- Page accueil iphone - Guide
- Numéro de page word - Guide