V
v_fas
I ahve a Word 2003 main.dot global template. I need to bea able to insert a
logo inside the header on the firs tpage; but to leave alone and not consider
a focus the second page header. below is the code.
************
Public Function InsertLogo(strLogoPath As String) As Boolean
On Error GoTo ErrHandler
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With ActiveDocument 'msadded
.PageSetup.DifferentFirstPageHeaderFooter = True 'msadded
With .Sections(1).Headers(wdHeaderFooterFirstPage) 'msadded
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.InlineShapes.AddPicture FileName:=strLogoPath,
LinkToFile:=False, _
SaveWithDocument:=True
InsertLogo = True
Exit Function
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End With 'msadded
End With
'############################
ErrHandler:
'############################
InsertLogo = False
FunctionName = "Main.InsertLogo"
strmsg = ""
Call Main.ErrorHandler(FunctionName, strmsg)
End Function
logo inside the header on the firs tpage; but to leave alone and not consider
a focus the second page header. below is the code.
************
Public Function InsertLogo(strLogoPath As String) As Boolean
On Error GoTo ErrHandler
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With ActiveDocument 'msadded
.PageSetup.DifferentFirstPageHeaderFooter = True 'msadded
With .Sections(1).Headers(wdHeaderFooterFirstPage) 'msadded
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.InlineShapes.AddPicture FileName:=strLogoPath,
LinkToFile:=False, _
SaveWithDocument:=True
InsertLogo = True
Exit Function
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End With 'msadded
End With
'############################
ErrHandler:
'############################
InsertLogo = False
FunctionName = "Main.InsertLogo"
strmsg = ""
Call Main.ErrorHandler(FunctionName, strmsg)
End Function