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

RE: Insert pics from folder by Mainer

Mainer
Mon Jul 14 10:40:03 PDT 2008

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

"Mainer" wrote:

> 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

Re: Insert pics from folder by Doug

Doug
Mon Jul 14 17:18:47 PDT 2008

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

"Mainer" <Mainer@discussions.microsoft.com> wrote in message
news:5F999366-B1E6-405A-B95B-A9A44028FD97@microsoft.com...
> 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
>
> "Mainer" wrote:
>
>> 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