Automating form functions

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hello,

I have a Word template that requires pictures to be imported to a "picture
field" if you will. They are being read from CD ROM disks. Each photo on the
CD has a .jpg and a .jpe extension. I only care about importing the .jpg
files.
Each page has two photos. Some of my projects can have as many as 50
pictures which would be 25 sheets.

Is there a way to automate the photo import portion and have a macro do the
following:

1. Open the source, Read the .jpg files from a dynamic path on a CD

2. Place each photo in individual frames, in numerical order (according to
file name)

3. Create a new page identical to the first as needed until the last picture
(file) is imported.

If someone has done this before I would appreciate the help.
If not, please point me in a direction where I can learn how to automate
word.

Thanks so much!

-Joe
 
Hi Joe

Yes, this can certainly be done.

If you're a brand-new, first-time user of VBA (which is Word's programming
language), then read up on


Creating a macro with no programming experience using the recorder
http://www.mvps.org/word/FAQs/MacrosVBA/UsingRecorder.htm

and

Getting To Grips With VBA Basics In 15 Minutes
http://www.mvps.org/word/FAQs/MacrosVBA/VBABasicsIn15Mins.htm


Then, have a more general look around
http://www.word.mvps.org/FAQs/MacrosVBA/index.htm.

In particular, look at http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm,
which provides a way to cycle through all the files in a folder.

Finally, if/when you need more help, post back to
microsoft.public.word.vba.beginners or microsoft.public.word.vba.general.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
Back
Top