Insert pics from folder

M

Mainer

I am trying to create a template to automate the creation of a word document.

I already have the template prompting the user for name, date, etc. It also
prompts the user for a filename for this particular case. I am now trying to
prompt the user for a folder containing bitmap images for that case.

The document consists of two columns containing bitmap images. The problem
is one case my have 4 images and the next may have 20 images. I was going to
use bookmarks but because I don't know the number of images from one case to
the next I'm not sure that is the best way to handle it.

I would like the user to be prompted to select a directory and then the code
would determine the number of *.BMP files in that directory and insert 4
images in each column with a blank line between each image. In order to fit
within the column each images needs to be sized to 2.75" in width. When it
gets to the bottom of column two insert a new page and continue on.

Your suggestions are greatly welcome and appreciated.

Mainer
 
M

Mainer

Ok, so I am now using msoFileDialogFolderPicker to select the directory and
am about to count the BMP files in the directory but will still need
assistance on how to setup the template to be able to insert a variable
amount of images.

Mainer
 
D

Doug Robbins - Word MVP

I would set up a two column one row table in the document with the cell
sizes set to those that you want and then iterate through the files in the
selected directory using the Dir function to get each file and insert it
into a cell of the table, adding new rows as required.

See the article "Find & ReplaceAll on a batch of documents in the same
folder" at:

http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top