0

I have 10 links to images in an Excel file, and I have 10 pages in a Microsoft Word document. I'd like the Microsoft Word document to import each image from the .xls file and place it in a designated spot in the .doc file.

Any advice on how to do this? I know perl/python scripts can, but I'd like to know if a more user-friendly option exists in Microsoft Office. Thanks!

  • Can you provide example files? – wysiwyg Feb 7 '17 at 23:59
0

I have used this VB macro code in Excel to copy 29 charts from one Excel sheet to a Word document.

If you have images rather than charts, you'll need to change the lines:

ActiveSheet.ChartObjects(i).Activate
ActiveChart.ChartArea.Copy

to something that selects and copies the data type you have.

Sub copycharts()

Dim word As Object
Dim doc As Object
On Error Resume Next

Set word = GetObject(, "word.application") 'gives error 429 if Word is not open
If Err = 429 Then
   Set word = CreateObject("word.application") 'creates a Word application
   Err.Clear
End If

With word
   .Visible = True
   .Documents.Add
End With

Sheets("charts").Select
i = 29
Do While i > 0
   ActiveSheet.ChartObjects(i).Activate
   ActiveChart.ChartArea.Copy
   With word.Selection
    'Paste Chart
   .Range.PasteSpecial Link:=False, DataType:=14, Placement:=wdInLine, _
       DisplayAsIcon:=False
   End With
i = i - 1
Loop
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.