View Full Version : [SOLVED:] Inserting multiple pictures in word document
magesh kumar
06-08-2017, 05:30 AM
Hi ,
When I am trying to insert multiple images to a word document using vba, latest one is getting inserted first. i.e, I have inserted images in this order img1, img2,img3.
But, in document, images are placed in this order " img3, img2, img1". can anyone help on this?
Thanks in advance,
Magesh...
gmaxey
06-08-2017, 05:44 AM
Where is your code?
magesh kumar
06-09-2017, 12:26 AM
Hi Max, My code is so simple, am just calling the below sub each time to insert image.
Sub addImage (wrdDoc As Word.Document, path As String)
wrdDoc.InlineShapes.AddPicture path
End Sub
gmaxey
06-09-2017, 06:09 AM
Sub addImage(wrdDoc As Word.Document, path As String)
Dim oRng As Range
Set oRng = wrdDoc.Range
oRng.Collapse wdCollapseEnd
wrdDoc.InlineShapes.AddPicture path, , , oRng
End Sub
macropod
06-09-2017, 02:30 PM
You might be interested in: http://www.vbaexpress.com/forum/showthread.php?44473-Insert-Multiple-Pictures-Into-Table-Word-With-Macro&p=281157&viewfull=1#post281157
magesh kumar
06-10-2017, 12:26 PM
Thanks Greg. It works Fine.
magesh kumar
06-10-2017, 12:35 PM
Thanks Paul. Yeah.. this is really an interesting and helpful.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.