Resize image en-tête WORD
b
Bonjour,
j'essai de remettre la taille d'origine d'une image qui se trouve dans l'en-tête de WORD.
Je suis capable avec les images qui ne sont pas en-tête.
voici mon code
Sub Resize()
Dim oSec As Section
Dim oHeader As HeaderFooter
Dim oLogo As InlineShape
PercentSize = 100
For Each oSec In ActiveDocument.Sections
Set oHeader = oSec.Headers(wdHeaderFooterPrimary)
With oHeader.Range
Set oLogo = .InlineShapes
End With
With oLogo
.Height = 75
.Width = 100
End With
Next oSec
'le bout suivant fonctionne pour les images qui ne sont pas dans l'en-tête
Dim PecentSize As Integer
Dim oIshp As InlineShape
Dim oshp As Shape
PercentSize = 100
For Each oIshp In ActiveDocument.InlineShapes
With oIshp
.ScaleHeight = PercentSize
.ScaleWidth = PercentSize
End With
Next oIshp
For Each oshp In ActiveDocument.Shapes
With oshp
.ScaleHeight Factor:=(PercentSize / 100), RelativeToOriginalSize:=msoCTrue
.ScaleWidth Factor:=(PercentSize / 100), RelativeToOriginalSize:=msoCTrue
End With
Next oshp
End Sub