Doneltac
07-20-2011, 11:28 PM
Hello everybody,
My first post on this forum, so a little introduction:
My name is Taco, I'm from the Netherlands. Thirtynine years old and my occupation is ICT manager of the Kremer Group (kremer.nl). I'm responsible for most of the ICT related issues, internal (roadmaps and purchasing) and external (sales and consultancy).
Regarding my question: I created a header/footer script with a nice form from which employes of our different departments can choose their own header/footer with corresponding logo's.
This works well on my own pc, and on some of the other pc's. But not on all of them. In a new document this script will put the header logo into the header, but it puts also the footer in the header. This happens only in a new document. Excisting document with more then two pages are no problem.
I checked the Word versions (we are talking about Word 2010) and upgraded them to the latest version (14.6032.1000 32bit), but the problem still exist.
This is the part of the script which is responsible of placing the header and footer:
Private Sub CommandButton1_Click()
With ActiveDocument.Sections(1)
.PageSetup.DifferentFirstPageHeaderFooter = True
With ActiveDocument
.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes.AddPicture ("header image.jpg")
With .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes(1)
.Width = 530
.Left = -50
.Top = -25
End With
.Sections(1).Footers(wdHeaderFooterFirstPage).Shapes.AddPicture ("footer image.jpg")
With .Sections(1).Footers(wdHeaderFooterFirstPage).Shapes(2)
.Width = 530
.Left = -50
.Top = 15
End With
.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture ("header image other pages.jpg")
With .Sections(1).Headers(wdHeaderFooterPrimary).Shapes(3)
.Width = 170
.Left = -50
.Top = -25
End With
End With
End With
End Sub
Can somebody tell me what I did wrong, or how I can solve this problem?
Best regards,
Taco
My first post on this forum, so a little introduction:
My name is Taco, I'm from the Netherlands. Thirtynine years old and my occupation is ICT manager of the Kremer Group (kremer.nl). I'm responsible for most of the ICT related issues, internal (roadmaps and purchasing) and external (sales and consultancy).
Regarding my question: I created a header/footer script with a nice form from which employes of our different departments can choose their own header/footer with corresponding logo's.
This works well on my own pc, and on some of the other pc's. But not on all of them. In a new document this script will put the header logo into the header, but it puts also the footer in the header. This happens only in a new document. Excisting document with more then two pages are no problem.
I checked the Word versions (we are talking about Word 2010) and upgraded them to the latest version (14.6032.1000 32bit), but the problem still exist.
This is the part of the script which is responsible of placing the header and footer:
Private Sub CommandButton1_Click()
With ActiveDocument.Sections(1)
.PageSetup.DifferentFirstPageHeaderFooter = True
With ActiveDocument
.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes.AddPicture ("header image.jpg")
With .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes(1)
.Width = 530
.Left = -50
.Top = -25
End With
.Sections(1).Footers(wdHeaderFooterFirstPage).Shapes.AddPicture ("footer image.jpg")
With .Sections(1).Footers(wdHeaderFooterFirstPage).Shapes(2)
.Width = 530
.Left = -50
.Top = 15
End With
.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture ("header image other pages.jpg")
With .Sections(1).Headers(wdHeaderFooterPrimary).Shapes(3)
.Width = 170
.Left = -50
.Top = -25
End With
End With
End With
End Sub
Can somebody tell me what I did wrong, or how I can solve this problem?
Best regards,
Taco