Hi,
One of my clients wants to simplify some procedures in Word. They
frequently add several images into Word documents, from 50 and up to
150. They create huge reports, and inserts the images at the end of
the report.
The images are actually miniature screen-shots of pages in a
pdf-document. They are created from the pdf and numbered from their
original page order. The images are sized and rotated so two images
fit on one page.
The problem is: If they select all images in a folder and insert them,
they will be inserted in the sort order in the folder. If they are
sorted Ascending, the images will be placed in the correct sort order
in the document. But: When reading the pages with images, the paper
obviously is rotated and the images displays as 2 - 1 on the first
page and 4 - 3 on the second page etc.
I have found out that I can sort the images in Descending order before
they are inserted. Then they will appear correctly if the pages are
printed in reverse order (if there is a even number of images of
course). This solution does not work when the images are part of a
larger document and if the pages have page numbers.
Is there any solution for this through vba? They have been doing it
manually until now, inserting one and one image (first 2, then 1, then
4,then 3 etc). An automatic solution would save several hours each
week.

Signature
Fredrik E. Nilsen
Bear - 12 Jun 2007 14:30 GMT
Fredrik:
Are the screen shots coming from a single PDF? Why not make a 2-up version
of the PDF document and use that as a supplemental document? If not, why not
use Acrobat to join the separate documents into one, then create the 2-up
version?
Taking the screen shots must represent a huge investment in time as well.
Failing all that, you could use VBA to:
- Assemble a list of all the screenshot files into an array
- Walk through the array in whatever order you choose, doing inserts
Bear

Signature
Windows XP, Word 2000
> Hi,
>
[quoted text clipped - 25 lines]
> 4,then 3 etc). An automatic solution would save several hours each
> week.
Fredrik E. Nilsen - 12 Jun 2007 22:14 GMT
>Fredrik:
>
[quoted text clipped - 9 lines]
>- Assemble a list of all the screenshot files into an array
>- Walk through the array in whatever order you choose, doing inserts
Hi, and thanks for your reply.
The problem with using Acrobat with or without a supplemental document
is that the complete document will have headers and footers with page
numbers etc.
I probably didn't make myself too clear about the screen shots. They
are not actual print-screen screen shots. They are saved as jpg-images
from Acrobat.
The array solution seems like the only option. I don't really have a
clue on where to start but I will make an effort on it. :)

Signature
Fredrik E. Nilsen
Bear - 12 Jun 2007 22:47 GMT
Fredrik:
It just so happens that another poster, Edward Thrashcort, recentlly shared
code for creating an array of all the files in a folder. Here it is:
Function myFileList()
Dim foundfile
Dim FileArray()
Dim filespec
filespec = "c:\*.*"
f = 0
foundfile = Dir(filespec)
Do While foundfile <> ""
f = f + 1
ReDim Preserve FileArray(1 To f)
FileArray(f) = foundfile
foundfile = Dir
Loop
MsgBox Str(UBound(FileArray)) + " files found"
End Function
Are you comfortable with VBA? If so, you have a good start in this code. All
you really need to do is come up with a way to advance through it by twos,
then backwards (you know what I'm trying to say).
Bear

Signature
Windows XP, Word 2000
> >Fredrik:
> >
[quoted text clipped - 22 lines]
> The array solution seems like the only option. I don't really have a
> clue on where to start but I will make an effort on it. :)
Fredrik E. Nilsen - 12 Jun 2007 23:19 GMT
>Fredrik:
>
[quoted text clipped - 21 lines]
>you really need to do is come up with a way to advance through it by twos,
>then backwards (you know what I'm trying to say).
Thanks again David,
I just located the post from Edward and am looking into it now. I'm
not too comfortable with VBA but I think I will be able to making
something useful out of it. :)

Signature
Fredrik E. Nilsen
Bear - 12 Jun 2007 23:28 GMT
Fredrik:
Once you get into VBA, I think you'll enjoy it. Just in case you haven't
discovered it already, there's lots of great information at the Word MVP site:
http://word.mvps.org/
You might start with this topic to get Edwards code in place quickly:
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm
Bear

Signature
Windows XP, Word 2000
> >Fredrik:
> >
[quoted text clipped - 27 lines]
> not too comfortable with VBA but I think I will be able to making
> something useful out of it. :)