Cutting and pasting images from Safari to Word

A

Alex Aisen

I'm new with a Mac.

I am trying to do something simple - copy an image from Google images
(viewed via Safari) to MS Word for the Mac 2004. If I copy the image and
then paste it in Word, the system pastes the HTML link to the image, not the
image itself.

If instead of using paste (i.e., command-V), I choose paste special from the
edit menu, and manually click on paste as "picture" rather than the default
paste as "unformated text" it works, and pastes the image.

Since I do this a lot, any way I can make the paste command paste the
picture itself, rather than the html link? I would think this would be the
default setting, but apparently it isn't.

I have a new iMac with the Pentium dual core processors, Mac OX 10.4.4 and
all available updates to the OS and Word installed.

Thanks!
 
D

Daiya Mitchell

Word doesn't let you set a default paste format.

The general approach would be to create a macro that pastes as picture, and
assign a keyboard shortcut to that macro, which could be cmd-v if you
wanted, or cmd-opt-v, or whatever.

Unfortunately, you can't record the macro, because the macro recorder in
Word 2004 is broken and doesn't produce the right steps for stuff involving
Paste Special. Arggh! But a macro can definitely be written, and isn't
even that difficult, just takes a little knowledge.

Someone will probably come along with one, or I'll dig around--I want this
for an article anyhow.

Interesting factoids:

TextEdit pastes the link, but Pages pastes the picture.

Right-click on image in Firefox offers only "copy image location" rather
than Safari's "copy image", while Opera offers separate "copy address" and
"copy image" commands.

Hope you are enjoying your new Intel Mac! Glad you found the groups here.
 
M

matt neuburg

Daiya Mitchell said:
Matt, can you share how to do that? because I can't figure it out and would
like to know as well.

Sorry, I leave that sort of thing to the Visual Basic experts...!
 
P

Paul Berkowitz

In Word, what I would do is just implement Paste As Picture as a menu
item so you can choose it without going thru the dialog. Or (this is
what I do) just use drag-and-drop from Safari to Word, rather than copy
and paste; somehow that causes Word to do the right thing. m.

Word doesn't seem to know this data type - at least with some pictures I've
copied in Safari and pasted without problem into TextEdit. Paste does
nothing in these cases (no text, no smart button). Paste As Picture is not
even available in Word, nor from Paste Special (only RTF, Formatted text,
Unformatted text), and any picture-type data type (Bitmap, MetaFilePicture,
etc.) errors at runtime in VBA.

As you say, drag and drop from Safari works fine.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Alex:

For the reasons others have mentioned, this is not an easy problem to solve.

Here's the macro:

Sub PastePicture()
'
' Macro recorded 30 January 2006 by John McGhie
' Attempts to paste the content of the clipboard as a picture

Selection.Range.PasteSpecial DataType:=wdPasteMetafilePicture

End Sub

Considerations:

Everything you have heard to date about the toxicity of VBA when dealing
with the clipboard is all true :) This is not just limited to VBA 5 -- no
version of VBA will allow you to find out IN ADVANCE what data types are
available on the clipboard.

Worse: if you ask for one that is NOT available, VBA blows up on an error in
the 5,000 range. Sadly, error numbers above 4,999 are generated by Word,
not VBA, so you cannot trap them with an error handler. The code will
always fail, the error message will always appear, and there's nothing you
can do about it.

By trial and error (!) I determined that in OS 10.3.9, Safari 1.3.2 appears
to be placing on the clipboard a data type that Word can paste as a
metafile. That is effectively what Edit>Paste Special>Picture does from the
user interface. "Picture" means a metafile format capable of containing a
mixture of anything you like -- either a raster or a vector graphic, or
text or drawing objects.

In Windows, this would be encapsulated in the document as a WMF metafile
unless the source uses a colour table greater than 256 colours, in which
case it would use EMF (32-bit) format. I suspect that Mac Word uses a PICT
metafile, but I don't have the tools here to dig around in the document to
find out what is actually in there.

The bottom line is that you can paste any graphics format as a metafile and
leave it to Word and OS X to cooperate on what the thing actually contains.

The problem we have here is that if you do not have anything on the
clipboard that will paste as a picture, you will see a nasty (albeit
self-explanatory) error message, and there's nothing I can do about that --
it's one of the untrappable series of errors.

Hope this helps


I'm new with a Mac.

I am trying to do something simple - copy an image from Google images
(viewed via Safari) to MS Word for the Mac 2004. If I copy the image and
then paste it in Word, the system pastes the HTML link to the image, not the
image itself.

If instead of using paste (i.e., command-V), I choose paste special from the
edit menu, and manually click on paste as "picture" rather than the default
paste as "unformated text" it works, and pastes the image.

Since I do this a lot, any way I can make the paste command paste the
picture itself, rather than the html link? I would think this would be the
default setting, but apparently it isn't.

I have a new iMac with the Pentium dual core processors, Mac OX 10.4.4 and
all available updates to the OS and Word installed.

Thanks!

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
P

Paul Berkowitz

This was with reference to Safari 2 (2.0.3) in OS 10.4 (10.4.4), John.

Selection.PasteSpecial DataType:=wdPasteMetafilePicture

doesn't work there - at least not for the pictures I've tried. Alex referred
to 10.4.4 and Matt said this was a new bug in Safari, meaning Safari 2 in OS
10.4, and I already reported that Word didn't recognize the DataType in
PasteSpecial VBA Method. It doesn't recognize the data type as
wdPasteMetafilePicture, nor as any of the others. It must be a new Cocoa
pasteboard datatype (possibly rtfd, rtf with attachments) - TextEdit
understands it just fine. This just doesn't work.

As Matt said, drag-and-drop works fine. So Word 2004 knows the type, but not
from the clipboard. And we all know that Office Mac's VBA has not been
updated since 1997, so VBA access just doesn't work.


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.

From: "John McGhie [MVP - Word and Word Macintosh]" <[email protected]>
Newsgroups: microsoft.public.mac.office.word
Date: Mon, 30 Jan 2006 23:59:40 +1100
Conversation: Cutting and pasting images from Safari to Word
Subject: Re: Cutting and pasting images from Safari to Word

Hi Alex:

For the reasons others have mentioned, this is not an easy problem to solve.

Here's the macro:

Sub PastePicture()
'
' Macro recorded 30 January 2006 by John McGhie
' Attempts to paste the content of the clipboard as a picture

Selection.Range.PasteSpecial DataType:=wdPasteMetafilePicture

End Sub

Considerations:

Everything you have heard to date about the toxicity of VBA when dealing
with the clipboard is all true :) This is not just limited to VBA 5 -- no
version of VBA will allow you to find out IN ADVANCE what data types are
available on the clipboard.

Worse: if you ask for one that is NOT available, VBA blows up on an error in
the 5,000 range. Sadly, error numbers above 4,999 are generated by Word,
not VBA, so you cannot trap them with an error handler. The code will
always fail, the error message will always appear, and there's nothing you
can do about it.

By trial and error (!) I determined that in OS 10.3.9, Safari 1.3.2 appears
to be placing on the clipboard a data type that Word can paste as a
metafile. That is effectively what Edit>Paste Special>Picture does from the
user interface. "Picture" means a metafile format capable of containing a
mixture of anything you like -- either a raster or a vector graphic, or
text or drawing objects.

In Windows, this would be encapsulated in the document as a WMF metafile
unless the source uses a colour table greater than 256 colours, in which
case it would use EMF (32-bit) format. I suspect that Mac Word uses a PICT
metafile, but I don't have the tools here to dig around in the document to
find out what is actually in there.

The bottom line is that you can paste any graphics format as a metafile and
leave it to Word and OS X to cooperate on what the thing actually contains.

The problem we have here is that if you do not have anything on the
clipboard that will paste as a picture, you will see a nasty (albeit
self-explanatory) error message, and there's nothing I can do about that --
it's one of the untrappable series of errors.

Hope this helps


I'm new with a Mac.

I am trying to do something simple - copy an image from Google images
(viewed via Safari) to MS Word for the Mac 2004. If I copy the image and
then paste it in Word, the system pastes the HTML link to the image, not the
image itself.

If instead of using paste (i.e., command-V), I choose paste special from the
edit menu, and manually click on paste as "picture" rather than the default
paste as "unformated text" it works, and pastes the image.

Since I do this a lot, any way I can make the paste command paste the
picture itself, rather than the html link? I would think this would be the
default setting, but apparently it isn't.

I have a new iMac with the Pentium dual core processors, Mac OX 10.4.4 and
all available updates to the OS and Word installed.

Thanks!

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 

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