"Paste Special" macro

P

Patrick

can anyone help me with what I see as a simple problem?

In Microsoft Word XP, I need a macro. One that automatically sees if I am
trying to paste text or an image. If the clipboard data is text I want it to
be pasted as "Unformatted Text", if the clipboard data is an image I want it
to be pasted as a "Device Independent Bitmap". Is this possible? any hints?

i've seen some that do the unformatted text paste, but it's the image
portion that i am most interested in.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?UGF0cmljaw==?=,
In Microsoft Word XP, I need a macro. One that automatically sees if I am
trying to paste text or an image. If the clipboard data is text I want it to
be pasted as "Unformatted Text", if the clipboard data is an image I want it
to be pasted as a "Device Independent Bitmap". Is this possible? any hints?

i've seen some that do the unformatted text paste, but it's the image
portion that i am most interested in.
In order to determine what's on the clipboard you'd need to use the Windows
API; I can't help you with that part. But once you have it, in order to specify
the file format, you set the DataType parameter of the Paste Special method.
These are listed in the Word object model (VBA) Help files. For example:
wdPasteDeviceIndependentBitmap

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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