erufailon86
New Member
- Joined
- May 20, 2014
- Messages
- 1
Hello,
I'm creating a script to take pictures from a excel document and insert them into a word document as part of a document creation script. I'm able to copy and past the picture into the word document but pastespecial only allows for pictures to be inserted as inline or above text. Is there a way to copy a picture and paste it into a word document behind the text?
I'm creating a script to take pictures from a excel document and insert them into a word document as part of a document creation script. I'm able to copy and past the picture into the word document but pastespecial only allows for pictures to be inserted as inline or above text. Is there a way to copy a picture and paste it into a word document behind the text?
Code:
Sub CopyPicturetoWord()
Dim WordApp As Object
Dim WordDoc As Object
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
Set WordDoc = WordApp.Documents.Add
WordDoc.PageSetup.Orientation = 1
ActiveSheet.Shapes("Picture").Copy
WordApp.Selection.PasteSpecial Link:=False, DataType:=8, _
Placement:=1, DisplayAsIcon:=False
Set WordDoc = Nothing
Set WordApp = Nothing
End Sub