How do you replace or update an embedded image?

J

jenniferaslan

I really need to be able to click an embedded image and, like in
Freehand or Illustrator, be able to select a new image that will be in
the same place and the same size. I hate that I always have to place
every image from scratch and size it EVERY TIME. I can't just update or
replace an embedded image.

I also need my images to be embedded so the presentation is
self-contained, so just placing linked images and using an add-in to
update linked images automatically won't help me.

Is there ANY WAY to do what I need? Is there an add-in? Or something
I'm missing somewhere, built into the software? I'm using Office X for
Mac.
 
J

Jim Gordon MVP

Hi Jennifer,

A macro should be able to accomplish what you are seeking. Since i don't
use Freehand or Illustrator I don't know the exact behavior you want.

A macro could determine the current size and position of a selected
picture, delete the picture, prompt you to insert a new picture from a
file and then resize the new picture to the dimensions of the previous
picture.

Does that sound like what you are looking for? Would the newly inserted
picture have to be in the same layer on the slide?

By default PowerPoint stores pictures within the presentation. You can
choose to link to pictures instead, but that is an option - not the
regular behavior.

-Jim
 
S

Steve Rindsberg

Hi Jennifer,

A macro should be able to accomplish what you are seeking. Since i don't
use Freehand or Illustrator I don't know the exact behavior you want.

A macro could determine the current size and position of a selected
picture, delete the picture, prompt you to insert a new picture from a
file and then resize the new picture to the dimensions of the previous
picture.

Or to be a little trickier, it could size the new picture so that it fits as
large as possible within the rectangle defined by the picture it's replacing,
w/o distorting. And via tags, remember that originally defined size so that
when it's replaced again, the size is maintained.

Where it gets tricky is if it needs to transfer all of the animation, color
adjustments and other settings from one picture to another.

================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
J

jenniferaslan

The way it works in FreeHand or Illustrator is there is a links
pallette. This lists the linked and embedded placed images that are
used in a document. You can click on the name of the image and choose
whether you want to update the link (if the placed image has been
edited) or change the file that you're linking to by choosing a
different file. When you choose a different file, the new image shows
up in the same place as the old one. In Illustrator the new image will
be as close to the same physical dimension (without changing the
correct aspect ratio) as it can be; in FreeHand the new image will be
the same scale percentage as the original. I think, for my PowerPoint
purposes, the Illustrator method would suit me better.

You guys have both suggested writing a Macro to do this, but I don't
know enough VBA script to do that. Can you point me to any Macros that
do what I'm wanting that have already been written?
 
J

Jim Gordon MVP

Hi Jennifer,

OK. There's something like that in Office. You can put Word Fields into
PowerPoint slides. There is a Word Field that might do the trick for you.

First, we need to do some setting up. I hope I don't leave out something
important!

Open Word 2004 to a blank document. From the TOOLS menu choose
CUSTOMIZE. click on the COMMANDS tab.

There are two commands that you should drag to any toolbar.
View Field Codes and Update Fields

The View Field Codes button will show you the field codes behind what I
will suggest that you try.

The Update Fields button will let you see how the Word Field preserves
the formatting - hopefully the way you desire it to be kept.

OK now Word is set up.

From Word's INSERT menu choose FIELD CODE

In the dialog box scroll down the right side to find INCLUDEPICTURE

The Word Field dialog box has an input field with INCLUDEPICTURE already
there. You have to type in a file path and also quotation marks around
the file path. For example you might type:
"Mac HD:Test Pictures:picture1.jpg"

There's a checkbox in the dialog to "Preserve formatting." Be sure that
is checked.

If you want to create a link to the file instead of incorporating the
image, click the OPTIONS button and add the \d switch

Click OK to close the dialog boxes.

If you see an empty square instead of the picture then you typed
something wrong.

Use the View Field Codes button to toggle between looking at the picture
and seeing the Field Code

If your file is exactly as in my example your Word Field would be
{ INCLUDEPICTURE "Mac HD:Test Pictures:picture1.jpg"\d \* MERGEFORMAT }

If you did not choose to preserve formatting then \ *MERGFORMAT will not
be part of the field code. I tell you this in case you want to put two
copies of the picture into the Word document (one with formatting
preserved and the other without) so you can compare what happens each way.

If things worked right, you should be able to use the View Field Codes
button to toggle back and forth between seeing the picture or seeing the
field code.

Now, select the entire field code by highlighting it. Then use Word's
EDIT COPY (or apple+C) and then switch to PowerPoint.

In PowerPoint use Edit > Paste (or Apple+V).

You should see the picture appear on the PowerPoint slide.

You can then edit the field code to change the picture. To do that,
control-click on the picture and choose Edit Document Object. Word will
then display the field code for you. You can type in or paste a new file
path, then click the Update Field Codes button.

Close the document window in Word and the new picture will now be in the
PowerPoint slide and the \ * MERGEFORMAT switch will preserve the
formatting.

Let me know if you were able to get through these instructions in one
piece and whether or not you think this sort of solution could work for you.

Thanks.

-Jim
 
S

Steve Rindsberg

You guys have both suggested writing a Macro to do this, but I don't
know enough VBA script to do that. Can you point me to any Macros that
do what I'm wanting that have already been written?

Jim's already got a sweet picture import macro for Mac PPT. Let's see if we
can nudge him to add this feature set too. <g>

Jim - think in terms of tagging the imported image with the full path it
originally came from.


================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
J

jenniferaslan

Jim,

Yes, that worked for me. Though it is definitely a workaround rather
than a really good solution, it'll do until something better and/or
simpler comes along. The trouble is that we have dozens of PPTs built
for our client that we occasionally have to make changes to and this
method would require us replacing all placed images with this image
field before the "edit document object" feature would be available. It
would just be a thing we could apply to new PPTs that we create from
here on out. At least it embeds the image so that when we give the PPT
to our client, he won't need to have all the images included with it.

As I was going through your instructions, I noticed that in Word, you
have to type the path of (rather than browse and choose) the image you
want to place. Some of our files have very long paths, since we have a
file server and a system of organizing our client jobs in folders, etc.
I have found a very handy little addition to the Finder's contextual
menu that helps a great deal. It's called CopyPath and you can find out
information about and download it here:
http://www.apple.com/downloads/macosx/system_disk_utilities/copypath.html

Basically, you can right-click (control+click) on any file in the
Finder and choose CopyPath in the contextual menu to copy the path of
that file to the Clipboard in Unix or HFS format. The HFS format works
perfectly for the path that Word wants when you insert the field. You
just have to put the quotes around it. Thought you guys might find that
useful.
 
J

jenniferaslan

I discovered that if I select "Object..." from the Insert menu in
PowerPoint, one of the choices is "Microsoft Word Picture." If I select
that I get automatically sent over to Word where I can do the Insert->
Field method that you've shown me. Since PowerPoint already knows about
the object, I can skip the copy-paste steps to get the image into my
PPT. It's already there.

I found this software and asked them about a Mac version:
http://www.pptxtreme.com/import_export.asp

It's only $50 and does everything I've been wanting, but this is what
they said: "We are sorry there is not a version available that will
work on the Mac. There does not seem to be enough interest to begin
development for the Mac." Rats.

Thanks for all your help.
 
J

Jim Gordon MVP

First thing that comes to mind is:
OLE container control
A Visual Basic control that is used to link and embed objects from other
applications in a Visual Basic application. Not available on the Macintosh.

-Jim
 
J

Jim Gordon MVP

I'm not sure I agree with everything they say about how PowerPoint
handles pictures, but then again I am more than half asleep at the moment.

Steve might be able to come up with some sort of macro using
CreateObject Function

-Jim
 
S

Steve Rindsberg

First thing that comes to mind is:
OLE container control
A Visual Basic control that is used to link and embed objects from other
applications in a Visual Basic application. Not available on the Macintosh.

Then you won't want to leave that in your mind, eh? ;-)

OK. Suppose you write your own insert picture routine and for all this to
work, the user's expected to use it instead of PPT's native menus. Fair
enough.

They click your button, choose a picture, you insert it.
At time of insert, you also tag it with the full path to the picture:

Call oShape.Tags.Add("Path", sPathToImage)

You also tag it with the original file's current time/date.

When the user clicks another button, you iterate through each shape on each
slide and

If Len(oShape.Tags("Path")) > 0 Then ' it's one of our linked images
' is the date of the same-named file on disk later than
' the date/time we've recorded when we added this image?
If DateOfFile(oShape.Tags("Path") > oShape.Tags("DateTime") Then
' Bring the file in again, replacing the existing one
' Needs some logic to decide the size/whether to distort or not
' and so forth




================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

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