S
Senad Isanovic
Need to modify this code. I'd like the logotype to be inserted on the first
page (header) in the document only, not on the other pages. Thaks! /Senad
Sub AddLogo()
Dim HeaderRange As Range
Const BookName As String = "logotype"
Set HeaderRange = ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary).Range _
.Bookmarks(BookName).Range
With HeaderRange
If .InlineShapes.Count = 0 Then
.Collapse
.InlineShapes.AddPicture _
FileName:="C:\bilder\al425.jpg", _
LinkToFile:=False, SaveWithDocument:=True
Set HeaderRange = HeaderRange.Paragraphs(1).Range
ActiveDocument.Bookmarks.Add BookName, HeaderRange
End If
End With
End Sub
page (header) in the document only, not on the other pages. Thaks! /Senad
Sub AddLogo()
Dim HeaderRange As Range
Const BookName As String = "logotype"
Set HeaderRange = ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary).Range _
.Bookmarks(BookName).Range
With HeaderRange
If .InlineShapes.Count = 0 Then
.Collapse
.InlineShapes.AddPicture _
FileName:="C:\bilder\al425.jpg", _
LinkToFile:=False, SaveWithDocument:=True
Set HeaderRange = HeaderRange.Paragraphs(1).Range
ActiveDocument.Bookmarks.Add BookName, HeaderRange
End If
End With
End Sub