PC Review


Reply
Thread Tools Rate Thread

4:3 -> Widescreen PPPresentation: VBA transfer help

 
 
=?Utf-8?B?QXJjeQ==?=
Guest
Posts: n/a
 
      8th Apr 2007
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!
 
Reply With Quote
 
 
 
 
Steve Rindsberg
Guest
Posts: n/a
 
      8th Apr 2007
In article <F9EFDDF7-3BDE-4153-BC08-(E-Mail Removed)>, Arcy wrote:
> 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
================================================


 
Reply With Quote
 
=?Utf-8?B?QXJjeQ==?=
Guest
Posts: n/a
 
      9th Apr 2007
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" wrote:

> In article <F9EFDDF7-3BDE-4153-BC08-(E-Mail Removed)>, Arcy wrote:
> > 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
> ================================================
>
>
>

 
Reply With Quote
 
Steve Rindsberg
Guest
Posts: n/a
 
      9th Apr 2007
In article <650F3E80-3E6F-4A73-80F8-(E-Mail Removed)>, Arcy wrote:
> 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" wrote:
>
> > In article <F9EFDDF7-3BDE-4153-BC08-(E-Mail Removed)>, Arcy wrote:
> > > 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
> > ================================================
> >
> >
> >

>


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


 
Reply With Quote
 
=?Utf-8?B?QXJjeQ==?=
Guest
Posts: n/a
 
      9th Apr 2007
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!


"Steve Rindsberg" wrote:

> 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.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do I need a Widescreen capable gfx card to use a widescreen flat panel? Mikey Windows XP Help 1 22nd May 2007 03:10 AM
non-widescreen apps on a widescreen monitor Rojo Habe Computer Hardware 5 3rd Mar 2007 05:21 PM
Widescreen res in DVI Bob Davis DIY PC 6 28th Apr 2006 10:05 PM
widescreen =?Utf-8?B?dG9t?= Windows XP General 5 22nd Jan 2006 07:22 PM
Widescreen DVD on widescreen monitor =?Utf-8?B?SlM=?= Windows XP General 0 2nd Nov 2005 03:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:18 PM.