4:3 -> Widescreen PPPresentation: VBA transfer help

G

Guest

I have a powerpoint presentation that is ~1k slides (each slide containing
one image), which comes out to around 175mb. This is not much of a problem,
it loads a little slow, but it fits on our thumbdrive, and it showcases the
work we want.

The problem is that 'It Has Been Decided' that we need a widescreen version
of this presentation. I, being the lowly student hire, have been tasked with
this.

I found one way of transfering the slides' contents from one 4:3
presentation to another widescreen formatted presentation thanks to a really
old post on these boards, which linked to here:
http://www.rdpslides.com/pptfaq/FAQ00566.htm . The VBA macro at the bottom of
that page worked like a charm...

....except that the new file size exploded to ~750 mbs. Doesn't like to load,
save, close, or do anything else really.

I did come across the PPTools optimizer, which shrunk it to ~500mb, but
that's still too large and runs slow. Looking at the VBA from that page, I
noticed that it's essentially taking a screencap of the old slides and
pasting that as an enhanced metafile (whatever that is). This means that the
new images have large bars the colour of our slide background (black)
wherever the image didn't take up the entire slide, making each image that
much bigger.

Is there a way to edit that VBA code to make it copy only the existing
images and transfer them over to the new file? (A solution I'm hoping will
shrink the file-size further - I tried doing this myself, but came up eith
some exciting errors.)

If not, is there anything else I can do to shrink the filesize?

Thanks!
 
S

Steve Rindsberg

I have a powerpoint presentation that is ~1k slides (each slide containing
one image), which comes out to around 175mb. This is not much of a problem,
it loads a little slow, but it fits on our thumbdrive, and it showcases the
work we want.

The problem is that 'It Has Been Decided' that we need a widescreen version
of this presentation. I, being the lowly student hire, have been tasked with
this.

I found one way of transfering the slides' contents from one 4:3
presentation to another widescreen formatted presentation thanks to a really
old post on these boards, which linked to here:
http://www.rdpslides.com/pptfaq/FAQ00566.htm . The VBA macro at the bottom of
that page worked like a charm...

....except that the new file size exploded to ~750 mbs. Doesn't like to load,
save, close, or do anything else really.

I did come across the PPTools optimizer, which shrunk it to ~500mb, but
that's still too large and runs slow. Looking at the VBA from that page, I
noticed that it's essentially taking a screencap of the old slides and
pasting that as an enhanced metafile (whatever that is). This means that the
new images have large bars the colour of our slide background (black)
wherever the image didn't take up the entire slide, making each image that
much bigger.

Is there a way to edit that VBA code to make it copy only the existing
images and transfer them over to the new file? (A solution I'm hoping will
shrink the file-size further - I tried doing this myself, but came up eith
some exciting errors.)

Assuming you're using 2003, locate this bit of code:

For Each oSourceSlide In oSourcePres.Slides
[snip snip snip]
oSourceSlide.Copy
Set oSh = oTargetSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1)

Change ppPasteEnhancedMetafile to ppPastePNG or ppPasteJPG

Make no other changes, then run the code on your original presentation, not one
that's already been "processed".

The original code uses metafiles so that you can still ungroup and edit the text
and other content if need be, but metafiles don't compress images, which is why
your converted version gets so badly bloated.

Switching to PNG or JPG images will leave the results uneditable but will give
you much better image compression.

Give it a try, c'mon back, report on the results. Thanks!
 
G

Guest

I changed that bit of code around, and tried some of the other options as
well. While it works (down to 254 mbs with jpg!), the downside is that there
is a noticable drop in the image's quality.

Is there a way to modify the code to make it - essentially - select all,
copy, and paste into the new PPP in the same way I would do it manually,
which doesn't alter the image quality (or carry-over the black bars on images
that don't extend to the page margins).

Steve Rindsberg said:
I have a powerpoint presentation that is ~1k slides (each slide containing
one image), which comes out to around 175mb. This is not much of a problem,
it loads a little slow, but it fits on our thumbdrive, and it showcases the
work we want.

The problem is that 'It Has Been Decided' that we need a widescreen version
of this presentation. I, being the lowly student hire, have been tasked with
this.

I found one way of transfering the slides' contents from one 4:3
presentation to another widescreen formatted presentation thanks to a really
old post on these boards, which linked to here:
http://www.rdpslides.com/pptfaq/FAQ00566.htm . The VBA macro at the bottom of
that page worked like a charm...

....except that the new file size exploded to ~750 mbs. Doesn't like to load,
save, close, or do anything else really.

I did come across the PPTools optimizer, which shrunk it to ~500mb, but
that's still too large and runs slow. Looking at the VBA from that page, I
noticed that it's essentially taking a screencap of the old slides and
pasting that as an enhanced metafile (whatever that is). This means that the
new images have large bars the colour of our slide background (black)
wherever the image didn't take up the entire slide, making each image that
much bigger.

Is there a way to edit that VBA code to make it copy only the existing
images and transfer them over to the new file? (A solution I'm hoping will
shrink the file-size further - I tried doing this myself, but came up eith
some exciting errors.)

Assuming you're using 2003, locate this bit of code:

For Each oSourceSlide In oSourcePres.Slides
[snip snip snip]
oSourceSlide.Copy
Set oSh = oTargetSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1)

Change ppPasteEnhancedMetafile to ppPastePNG or ppPasteJPG

Make no other changes, then run the code on your original presentation, not one
that's already been "processed".

The original code uses metafiles so that you can still ungroup and edit the text
and other content if need be, but metafiles don't compress images, which is why
your converted version gets so badly bloated.

Switching to PNG or JPG images will leave the results uneditable but will give
you much better image compression.

Give it a try, c'mon back, report on the results. Thanks!

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

Steve Rindsberg

I changed that bit of code around, and tried some of the other options as
well. While it works (down to 254 mbs with jpg!), the downside is that there
is a noticable drop in the image's quality.

That's the dark side of JPGs. Might want to see how it works with PNGs instead.
Is there a way to modify the code to make it - essentially - select all,
copy, and paste into the new PPP in the same way I would do it manually,
which doesn't alter the image quality (or carry-over the black bars on images
that don't extend to the page margins).

Probably so but it'll take a lot more coding to get it right. What makes it simple
(as is) is that you can treat all the shapes on the slide as a single grouped unit
for scaling purposes.

If you copy/paste individually or copy/paste the shapes on a slide, you run into
troubles 'cause PPT won't let you group placeholders. And if you can't scale/move
the shapes as a group, it gets trickier by far.


Steve Rindsberg said:
I have a powerpoint presentation that is ~1k slides (each slide containing
one image), which comes out to around 175mb. This is not much of a problem,
it loads a little slow, but it fits on our thumbdrive, and it showcases the
work we want.

The problem is that 'It Has Been Decided' that we need a widescreen version
of this presentation. I, being the lowly student hire, have been tasked with
this.

I found one way of transfering the slides' contents from one 4:3
presentation to another widescreen formatted presentation thanks to a really
old post on these boards, which linked to here:
http://www.rdpslides.com/pptfaq/FAQ00566.htm . The VBA macro at the bottom of
that page worked like a charm...

....except that the new file size exploded to ~750 mbs. Doesn't like to load,
save, close, or do anything else really.

I did come across the PPTools optimizer, which shrunk it to ~500mb, but
that's still too large and runs slow. Looking at the VBA from that page, I
noticed that it's essentially taking a screencap of the old slides and
pasting that as an enhanced metafile (whatever that is). This means that the
new images have large bars the colour of our slide background (black)
wherever the image didn't take up the entire slide, making each image that
much bigger.

Is there a way to edit that VBA code to make it copy only the existing
images and transfer them over to the new file? (A solution I'm hoping will
shrink the file-size further - I tried doing this myself, but came up eith
some exciting errors.)

Assuming you're using 2003, locate this bit of code:

For Each oSourceSlide In oSourcePres.Slides
[snip snip snip]
oSourceSlide.Copy
Set oSh = oTargetSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1)

Change ppPasteEnhancedMetafile to ppPastePNG or ppPasteJPG

Make no other changes, then run the code on your original presentation, not one
that's already been "processed".

The original code uses metafiles so that you can still ungroup and edit the text
and other content if need be, but metafiles don't compress images, which is why
your converted version gets so badly bloated.

Switching to PNG or JPG images will leave the results uneditable but will give
you much better image compression.

Give it a try, c'mon back, report on the results. Thanks!

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

Guest

I can definitly see the benifit of that... the metafile would work great for
slides with large amounts of content on them.

I managed to hack together my own solution in VBA to automate much of it,
and I'll include the code below for anyone interested. It will copy a
selected image on one slide, create a new slide on a second presentation,
paste the image, and then resize/center it on the new slide.

The Setup: Ensure both presentations are open and onscreen
(Window->Cascade). Select the image you want to copy from the old
presentation, and run the macro. To copy the next image, reselect the
original presentation, move to the next slide, select the next image, and
wash, rince, repeat.

The Code:

Sub copyImageAndResizeForHeight()

‘yay variables
Dim oView As View
Dim oTargetPres As Presentation
Dim dSafeMargin As Double

‘copy the currently selected image in the original presentation window,
‘and then select the new, widescreen formatted presentation
ActiveWindow.Selection.Copy
Windows.Item(Index:=2).Activate


‘in the wide presentation, create a new blank slide
With ActivePresentation.Slides
Set oView = ActiveWindow.View
oView.GotoSlide .Add(oView.Slide.SlideIndex + 1, _
ppLayoutBlank).SlideIndex
Set oView = Nothing
End With

‘paste the image into the new slide in the widescreen presentation
ActiveWindow.View.Paste

‘The rest of this code resizes the image to make it the full height of the
slide
Set oSh = ActiveWindow.Selection.ShapeRange
Set oTargetPres = ActivePresentation
dSafeMargin = 0 ‘alter this number if you want a margin above&below your
image

With oTargetPres.PageSetup
‘resize
oSh.Height = .SlideHeight - (dSafeMargin * 2)

' center
oSh.Left = (.SlideWidth - oSh.Width) / 2
oSh.Top = (.SlideHeight - oSh.Height) / 2

End With

End Sub

I created a second version of this macro for instances where the image was
significantly wider then it was tall. In this case, it would resize the image
to fit the width of the screen. It's all the same except for one line,
changing:
oSh.Height = .SlideHeight - (dSafeMargin * 2)
to:
osh.Width = .SlideWidth - (dSafeMargin * 2)

Took me ~30 minutes to go through each slide all told, but it allowed me to
ensure each image was sized correctly, and kept the file size exactly the
same. If someone can find a way to automate the rest of it, all the more
power to them.

Thanks for the help/info Steve!
 

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