pasteSpecial centers graphics?

G

Gary Fritz

I suspect this isn't the optimal group to post this question, so if there's
a better place, please point me there...

I'm developing some training using Powerpoint and Word 2003. I'm supposed
to copy the slides in PPT and paste them into Word using a provided macro.
The macro includes:
Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

This works just fine, except one thing. The resulting metafile graphic is
always a fixed width (605 pixels, not sure where that came from), which is
OK. But the paste-as-WMF insists on CENTERING the graphic in the resulting
WMF.

This is a pain because it means my nicely-formatted slides end up all over
the page. I want them all to be left-justified the way they are in PPT, so
they line up with the other objects in Word.

Is it possible to control the PasteSpecial operation so it doesn't center
the WMF?

Thanks!
Gary
 
J

Jezebel

It's not PasteSpecial that's centering your graphics. That's most likely an
'autoshape default'. Paste one graphic and position it exactly as you want
it. Then right-click and select 'Set Autoshape defaults' -- the settings
should be applied to further graphics you paste.
 
G

Gary Fritz

Jezebel said:
It's not PasteSpecial that's centering your graphics. That's most
likely an 'autoshape default'. Paste one graphic and position it
exactly as you want it. Then right-click and select 'Set Autoshape
defaults' -- the settings should be applied to further graphics you
paste.

I don't think you understand. It's not the position of the WMF picture
on the Word page that I care about. It's the position of the copied PPT
slide **within** the WMF picture -- which I assume is determined by the
clipboard-to-WMF conversion step, which happens in the PasteSpecial. And
I can't reposition that, short of editing and re-saving the picture.

In other words, the PasteSpecial creates a 605-pixel-wide picture. If
the PPT slide was narrow, e.g. let's say it had 4 lines of one word each,
then the copied image is centered within the 605-pixel width, starting
maybe 250 pixels from the left side. But if one of those 4 lines was a
long line that took up the width of the PPT slide, then the copied image
gets pushed to the left side of the 605 pixels.

If you're displaying this message with a fixed-pitch font, the two
resulting WMF images would look something like this:

---------------- 605 pixels wide -------------------------------
| |
| four |
| really |
| short |
| lines |
| |
---------------- 605 pixels wide -------------------------------

---------------- 605 pixels wide -------------------------------
| |
| three |
| short |
| lines |
| and one that extends across the entire width of the slide |
| |
---------------- 605 pixels wide -------------------------------

I want them all to look like the second image, even if the slide is
narrow. That way they'll line up with the other titles &etc on the page
in the Word document. If the clipboard-to-WMF centers the image within
the WMF picture, then the only way I can line the slide up with the
surrounding text is by setting the indents differently for each slide,
usually outside the margins of the page.

Gary
 
J

Jezebel

OK, yes I understand the problem now. But it's still nothing to do with
PasteSpecial --- that just moves the contents of the clipboard (whatever
that may be) into the document. The problem is with the Copy function at the
PPT end.
 
G

Gary Fritz

Jezebel said:
OK, yes I understand the problem now. But it's still nothing to do
with PasteSpecial --- that just moves the contents of the clipboard
(whatever that may be) into the document. The problem is with the Copy
function at the PPT end.

Hm. My first reaction was "no way" -- if I copy a bulleted list in PPT, I
can paste it normally into Word and it pastes as formatted text. If I
Paste Special, it pastes as formatted text, unformatted text, or a picture,
depending on the format I choose. Surely, I thought, the PasteSpecial
operation is invoking the convert-to-WMF operation when you specify it.

But with a bit more experimentation, I discovered if I copy in a text-only
app, I can't PasteSpecial as WMF -- it only offers text formats. Obviously
the contents of the clipboard aren't plain text, even if PPT copies text.

As a better proof, I tried copying a narrow column of words in Word, and
pasting as a picture. Shazam: it's left-justified. So apparently the WMF
creation happens on the copy side, and PPT is doing it wrong. OK, I'll
look in that direction.

Thanks for pointing me in the right direction!
Gary
 

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