Sub
picsHeaderFooter()
Dim
oShape
As
Shape, oRange
As
Range, fRange
As
Range, fShape
As
Shape
Dim
PfadKopf
As
String
PfadKopf =
"C:\Users\xy\Desktop\KörnerVorlage\Kopfzeile.jpg"
Dim
PfadFuss
As
String
PfadFuss =
"C:\Users\xy\Desktop\KörnerVorlage\Fusszeile.jpg"
Set
oRange = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Set
oShape = ActiveDocument.Shapes.AddPicture(FileName:=PfadKopf, _
LinkToFile:=
False
, SaveWithDocument:=
True
, Anchor:=oRange)
oShape.Height = CentimetersToPoints(3.97)
oShape.Width = CentimetersToPoints(21.19)
oShape.Left = CentimetersToPoints(-2.8)
oShape.Top = CentimetersToPoints(-1.2)
Set
fRange = ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range
Set
fShape = ActiveDocument.Shapes.AddPicture(FileName:=PfadFuss, _
LinkToFile:=
False
, SaveWithDocument:=
True
, Anchor:=fRange)
fShape.Height = CentimetersToPoints(2.95)
fShape.Width = CentimetersToPoints(21.06)
fShape.Left = CentimetersToPoints(-2.79)
fShape.Top = CentimetersToPoints(-1.4)
End
Sub