babsiee
10-28-2012, 01:31 PM
Hi Guys, I have two questions. Hope you guys can help me!
1. Image behind text in footer
I have made a macro that adds images in the header and footer of my word document. However, I would like my image in the footer to go behind the text. How can I do this in my macro? What code should I add? Hope you guys can help me.
2. Fullsize image
Is there a possibility that my images in the header and footer will not resize automaticly? I have made an image that is as width as my paper so it would be nice if the image will be inserted at it's original size.
Thank you so much for reading. Looking forward to your response.
This is my code until now:
Sub TITLE()
'
' TITLE Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader 'headers van de pagina's 2 en verder
Selection.InlineShapes.AddPicture FileName:= _
"C:\header-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
WordBasic.ViewFooterOnly 'Footers van de pagina's 2 en verder
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).InlineShapes.AddP icture FileName:="C:\footer-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
Dim asection As Section
Set asection = Selection.Sections(1)
With asection
With .PageSetup
End With
'header pagina 1
.Headers(wdHeaderFooterFirstPage).Range.InlineShapes.AddPicture FileName:="C:\header-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
'footer pagina 1
.Footers(wdHeaderFooterFirstPage).Range.InlineShapes.AddPicture FileName:="C:\footer-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
End With
End Sub
1. Image behind text in footer
I have made a macro that adds images in the header and footer of my word document. However, I would like my image in the footer to go behind the text. How can I do this in my macro? What code should I add? Hope you guys can help me.
2. Fullsize image
Is there a possibility that my images in the header and footer will not resize automaticly? I have made an image that is as width as my paper so it would be nice if the image will be inserted at it's original size.
Thank you so much for reading. Looking forward to your response.
This is my code until now:
Sub TITLE()
'
' TITLE Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader 'headers van de pagina's 2 en verder
Selection.InlineShapes.AddPicture FileName:= _
"C:\header-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
WordBasic.ViewFooterOnly 'Footers van de pagina's 2 en verder
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).InlineShapes.AddP icture FileName:="C:\footer-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
Dim asection As Section
Set asection = Selection.Sections(1)
With asection
With .PageSetup
End With
'header pagina 1
.Headers(wdHeaderFooterFirstPage).Range.InlineShapes.AddPicture FileName:="C:\header-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
'footer pagina 1
.Footers(wdHeaderFooterFirstPage).Range.InlineShapes.AddPicture FileName:="C:\footer-image.jpg", LinkToFile:= _
False, SaveWithDocument:=True
End With
End Sub