replace with image

S

smiffy

Can anyone tell me why when using vba, I cannot replace
text with an image when the text is in a text box?

Iam using:-

For RT = 1 To 200

'find word

ActiveDocument.Range(0, 0).Select
With Selection.Find
.ClearFormatting
.Text = "IMAGE"
.Forward = True
.Execute


'Insert pic

Selection.InlineShapes.AddPicture FileName:="C:\Import\" &
RT & "." & "1.jpg", _
LinkToFile:=False, SaveWithDocument:=True
End With


Next RT


Is it not possible or is my code preventing the
replacement somehow?
It works fine when the word "image" is not in a textbox.

It has to be in a textbox as I want some text to
appear "wrapped" to the side of the image, but I cannot
covert the image to a word shape.....The image has to
remain as in inlineshape because there is are other
shapes on the same page that have formatting applied to
them and the formatting would end up being applied to the
images too.

Thanks for any help

Smiffy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top