kelseyvdh
09-07-2018, 09:57 AM
Hi everyone,
I'm trying to replace some text in a Word-file with a copy of a range from Excel. I want to paste the range as an image. At this point, it does paste the range as an image, but I can't seem to fix it so it would replace the specific text. My code is as following:
With msWord.Content.Find
Sheets("Offerte").Range("I13:M160").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
.Text = ("<<TABEL>>")
.Replacement.Text = msWord.Selection.Paste
msWord.Selection.TypeParagraph
End With
So to elaborate: the Range I13:M160 of the Sheet "Offerte" has to replace the text "<<Tabel>>" in the Word-document. Everything works, except for the replacement of the text.
Any ideas? Many thanks in advance!
I'm trying to replace some text in a Word-file with a copy of a range from Excel. I want to paste the range as an image. At this point, it does paste the range as an image, but I can't seem to fix it so it would replace the specific text. My code is as following:
With msWord.Content.Find
Sheets("Offerte").Range("I13:M160").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
.Text = ("<<TABEL>>")
.Replacement.Text = msWord.Selection.Paste
msWord.Selection.TypeParagraph
End With
So to elaborate: the Range I13:M160 of the Sheet "Offerte" has to replace the text "<<Tabel>>" in the Word-document. Everything works, except for the replacement of the text.
Any ideas? Many thanks in advance!