View Single Post
 
Old 12-08-2015, 08:43 AM
addey addey is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Feb 2015
Posts: 10
addey is on a distinguished road
Default

Why on Earth would I want to replace a figure caption with an image of the same caption? That makes no sense... And why would I call a figure caption "figure"? Never mind, I am looking for a possible solution, not semantics.

The issue is the following: The tool I am importing the Word documents to can distinguish "flat" images (such as a jpeg or a png that is pasted or inserted in a document), but it won't import for example figures made within Word itself (like text boxes, lines etc..), but by replacing these with .png or .jpg representations of the same images, the import works just fine. The manner in which I create the .png/.jpg files doesn't really matter, I just mentioned Word Cleaner for sake of clarity, as this is the tool that does this part of the job. The bottom line is that I have created .png files of the figures, and I want to create a script that removes the original figure, and inserts (pastes, whatever, it "just" needs to be in the correct place) the .png file where the original figure was. I don't need a link, like I already said I have a script that just runs through all figures in the document. That script has a counter, and what I want is when it has found the first figure (counter=1), then it removes the figure, and inserts filename_001.png. When it gets to the second figure (counter=2), it removes the figure, and inserts filename_002.png. I have the initial script, but I am missing the part where I insert the file in the specific position where the image was.

So to sum up, what I really need, is a way to insert the contents of a picture file (in .png format, but that shouldn't matter) in a Word document via VBA.
Reply With Quote