Hi there,
Please can someone help me with this.
I've created quite a few individual Word docs that all contain a common image in the footer. Because of my lack of experience with Word (more of a Quark man) I have inserted the image in each document. I now need to update the image, in every footer, in every document (that means approximately 250-300 updates)! Yep, I'll bet there are better ways of doing this I know and I'm kicking myself I didn't use one of them.
I was hoping to do this update using vba to run through all the files in a folder and apply this change to the footers. I already have some code for looping through files in a folder (thanks Gerry!) however it's the updating/ insertion of the new image I'm trying to solve.
So far I'm playing with this trying to get it to work:-
Sub Insert_Pic()
' declare an InlineShape object variable
Dim MyShape As Shape
' store the pointer to the new shape
Set MyShape = ActiveDocument.Shapes.AddPicture(FileName:=_
"C:\Documents and Settings\pathToFooter\jcfooter_test.tif", _
LinkToFile:=False, SaveWithDocument:=True, Anchor:=Selection.Range)
' set properties of the Shape object
With MyShape
.Width = 492.75
.Height = 32.25
.ZOrder msoSendBehindText
.WrapFormat.Type = wdWrapNone
.RelativeHorizontalPosition = wdRelativeHorizontalPositionCharacter
.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
.Left = 0
.Top = InchesToPoints(0.02)
End With
End Sub
I've found the code somewhere and have managed to get as far as the insertion of an image, however, one problem I've encountered is that when I try apply the new settings nothing happens.
Secondly, I'm also wanting to put this in some loop that deletes the current footer image.
Any help would be appreciated with this, thanks.
Nick
Edited by GeekGirlau 21-Apr-06. Reason: put line breaks in code