Hi Jay,
Try tackling this program on step at the time. You may use the macro
recorder to get the code necessary to insert the picture into the
document. Same way, the creation of a page break.
Try that, and have a look at the code. This will give you an idea how
you can write a program in VBA. It will not yet be optimal, but that
can be arranged at a later stage.
Also, use the Help-file extensively. This gives extra information about
the commands. Put the cursor on a keyword, and press F1. That will
bring up a Help-item.
The last thing you'll need for this program is the For Each Next loop
construction. Look it up in the Help file. This lets you cycle through
all the items in a list (a subdirectory in your case) without having to
know how many items there are.
Give it a try!
Richard (NL)
Quote:
> Hi all,
> I am a newbie in Word 97. Could someone show me how to write a VBA
program
> to do the following:
> - Given a directory called C:\mybook.
> - I have a number of *.PCX scanned image files.
> 1. File->New document
> 2. Go to C:\mybook, find out how many and the names of the *.PCX
files.
> 3. For each *.PCX file, do the following
> a. simulate Insert menu->Picture->From File...,
programmatically
> select the current file
> b. insert this PCX file into the existing Word document.
> c. insert a page break after the PCX image so that the next
image
> will appear on the next page of the document.
> d. continue this loop until no more files to be processed in
> C:\mybook.
> Could someone help me with this VBA program?
> Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.