Copy Picture from Excel to Word and insert behind the text

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?

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
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Maybe...

Code:
 WordApp.Selection.Paste
 With WordDoc
    .InlineShapes(.InlineShapes.Count).ConvertToShape.WrapFormat.Type = wdWrapBehind
 End With

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,216,126
Messages
6,129,007
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top