MegaSack DRAW - This year's winner is user - rgwb
We will be in touch
Can anyone help me with Word macro's? I have a large table with a column for pictures, which I would like to put a unique number into which corresponds to a jpeg file in my pictures folder.
Can I use a macro to automatically insert the pictures?
Thanks Shakey
Bump - anyone please help as this is doing my head in!
As long as you're using windows not mac, this little wonder macro should do the actual inserting a picture bit.
Where I do CStr(CInt( that is just to make sure that we only have the number, and not any carriage returns / spaces / wacky table things around it.
[code]
Sub Replace_Number_With_File()
filenumber = CStr(CInt(Selection.Text))
FileName = "c:\temp\arrow" + filenumber + ".png"
Debug.Print FileName
Selection.InlineShapes.AddPicture FileName, False, True
End Sub
[/code]
Then you need to iterate over the table, and find the right cells, and find each filename that you want to do, select the right bit, and then stick it in. If you know VBA, it is pretty doable, just a little fiddly, I don't have the time to play with it myself (it is much easier if you have the actual target document to hand anyway). If you don't know VBA, well at least the macro above will let you select a single number and replace it with a picture.
Joe
