Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 12-10-2015, 01:34 AM
addey addey is offline Replacing all images in a document with numbered files Windows 7 64bit Replacing all images in a document with numbered files Office 2010 64bit
Novice
Replacing all images in a document with numbered files
 
Join Date: Feb 2015
Posts: 10
addey is on a distinguished road
Default

Thanks for the suggestion Guessed! The issue is however not to get the image files out, but to get them back in at the correct place. And since the problem originally is the various image formats used within Word, simply using the ones in the zip file won't work.

Getting images into a Word doc is not a problem, this small code inserts the three test images I made in a sequential order.
Code:
Sub InsertImage()
    Dim i As Integer 
    For i = 1 To 3 
        Selection.InlineShapes.AddPicture FileName:= _
        "C:\path\test" & i & ".png", LinkToFile:=False, _
        SaveWithDocument:=True
    Next i
End Sub
As there are also ways of going through a document, selecting each InlineShape on the way, I was hoping there was a way to link the Selection in the above code to a selection in a code that runs through a document finding InlineShapes.

Macropod, the png images I want to include in the document are also sequentially numbered, and I know there is a way to walk through all InlineShapes in the document (i.e. sequential). And since it is also not a problem inserting an image at a selection, why would this be impossible? I am a VBA newb, so I'm just trying to figure stuff out... but getting a "that's not possible" answer when I see the outlines of a solution only wants me to dig deeper.

I am thinking of something like this (pseudocode):
Code:
For i = 1 to numberOfInlineShapesInDoc
  Select InlineShape
  Delete InlineShape
  Insert image_i.png 'one of the sequentially numbered images
Next i
Reply With Quote
 

Tags
change, figures



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing all images in a document with numbered files Replacing multiple words at once in excel document Legaly Excel 2 05-23-2014 08:30 AM
Replacing all images in a document with numbered files Insert images with incrementallly-numbered filenames mqx Word VBA 4 11-13-2013 11:22 AM
Replacing all images in a document with numbered files Number position for numbered list of images ofey Word 3 09-29-2013 02:51 AM
Replacing text string within document, it's not retaining formatting livemusic Word 4 02-25-2013 12:33 AM
Replacing all images in a document with numbered files Flowing Numbered Lists Around Images Paul_A_Parks Drawing and Graphics 5 03-09-2011 10:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft