A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Reset slide layout in VBA (PP2007)



 
 
Thread Tools Display Modes
  #1  
Old September 14th, 2007, 12:51 PM posted to microsoft.public.powerpoint
Luca Brasi
external usenet poster
 
Posts: 43
Default Reset slide layout in VBA (PP2007)

In PP2007 I can reset a slide to the definitions of its custom layout
manually (tab Home, group Slides, button Reset).

Is there a way to do such a reset in VBA?

Thanks for any hints.
  #2  
Old September 14th, 2007, 01:12 PM posted to microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default Reset slide layout in VBA (PP2007)

Does this work?

Dim oLay As PpSlideLayout
oLay = ActiveWindow.Selection.SlideRange(1).Layout
ActiveWindow.Selection.SlideRange(1).Layout = oLay

You maybe want to look at "Hands Off my Master" too
http://www.pptalchemy.co.uk/HandOff.html

--
Amazing PPT Hints, Tips and Tutorials-
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk


"Luca Brasi" wrote:

In PP2007 I can reset a slide to the definitions of its custom layout
manually (tab Home, group Slides, button Reset).

Is there a way to do such a reset in VBA?

Thanks for any hints.

  #3  
Old September 14th, 2007, 02:05 PM posted to microsoft.public.powerpoint
Luca Brasi
external usenet poster
 
Posts: 43
Default Reset slide layout in VBA (PP2007)

John, thanks for your message but it don't work.

Anyway, In my opinion the "Layout" property of the slide object
shouldn't be used anymore in PP2007, as PP2007 uses the new Custom
Layout concept. If you create some new custom slide layouts, the
"Layout" property just returns ppLayoutCustom which isn't really helpful.


John Wilson wrote:
Does this work?

Dim oLay As PpSlideLayout
oLay = ActiveWindow.Selection.SlideRange(1).Layout
ActiveWindow.Selection.SlideRange(1).Layout = oLay

You maybe want to look at "Hands Off my Master" too
http://www.pptalchemy.co.uk/HandOff.html

  #4  
Old September 14th, 2007, 04:31 PM posted to microsoft.public.powerpoint
Shyam Pillai
external usenet poster
 
Posts: 622
Default Reset slide layout in VBA (PP2007)

Luca,
PPT 2007 requires a slightly different approach. All the change it needs is
to get the reference to the custom layout and it can be reapplied. Take a
look at this page.
http://skp.mvps.org/2007/ppt002.htm

--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com



"Luca Brasi" wrote in message
...
John, thanks for your message but it don't work.

Anyway, In my opinion the "Layout" property of the slide object shouldn't
be used anymore in PP2007, as PP2007 uses the new Custom Layout concept.
If you create some new custom slide layouts, the "Layout" property just
returns ppLayoutCustom which isn't really helpful.


John Wilson wrote:
Does this work?

Dim oLay As PpSlideLayout
oLay = ActiveWindow.Selection.SlideRange(1).Layout
ActiveWindow.Selection.SlideRange(1).Layout = oLay

You maybe want to look at "Hands Off my Master" too
http://www.pptalchemy.co.uk/HandOff.html


  #5  
Old September 14th, 2007, 09:39 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default Reset slide layout in VBA (PP2007)


Hi Luca,

Glad you showed up again.

This is re your earlier question about title masters.

If there's no Title Slide layout present, you can do

ActivePresentation.AddTitleMaster

In earlier versions of PPT, this adds a new title master. In 2007 it adds a
new Title Slide layout.

Now assuming you already have another layout that you want to designate as the
"Title Master", you could, I think, use the above, then copy all of the shapes
from your layout to the new one and you're done.

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


  #6  
Old September 15th, 2007, 10:44 AM posted to microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default Reset slide layout in VBA (PP2007)

Thanks Shyam (and Luca) I missed the ref to 2007. I'll add that info to my
personal KB!!
--
Amazing PPT Hints, Tips and Tutorials-
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk


"Shyam Pillai" wrote:

Luca,
PPT 2007 requires a slightly different approach. All the change it needs is
to get the reference to the custom layout and it can be reapplied. Take a
look at this page.
http://skp.mvps.org/2007/ppt002.htm

--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com



"Luca Brasi" wrote in message
...
John, thanks for your message but it don't work.

Anyway, In my opinion the "Layout" property of the slide object shouldn't
be used anymore in PP2007, as PP2007 uses the new Custom Layout concept.
If you create some new custom slide layouts, the "Layout" property just
returns ppLayoutCustom which isn't really helpful.


John Wilson wrote:
Does this work?

Dim oLay As PpSlideLayout
oLay = ActiveWindow.Selection.SlideRange(1).Layout
ActiveWindow.Selection.SlideRange(1).Layout = oLay

You maybe want to look at "Hands Off my Master" too
http://www.pptalchemy.co.uk/HandOff.html



  #7  
Old September 16th, 2007, 07:47 PM posted to microsoft.public.powerpoint
Luca Brasi
external usenet poster
 
Posts: 43
Default Reset slide layout in VBA (PP2007)

Thanks for this info Steve.


Steve Rindsberg wrote:
Hi Luca,

Glad you showed up again.

This is re your earlier question about title masters.

If there's no Title Slide layout present, you can do

ActivePresentation.AddTitleMaster

In earlier versions of PPT, this adds a new title master. In 2007 it adds a
new Title Slide layout.

Now assuming you already have another layout that you want to designate as the
"Title Master", you could, I think, use the above, then copy all of the shapes
from your layout to the new one and you're done.

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


  #8  
Old September 16th, 2007, 08:20 PM posted to microsoft.public.powerpoint
Luca Brasi
external usenet poster
 
Posts: 43
Default Reset slide layout in VBA (PP2007)

Thanks Shyam, but I know that I can reapply a layout to a slide. My
question was about doing a "Reset" of a slide (like using tab Home,
group Slides, button Reset). In Office 2007 reapplying a layout and
reseting a slide are two different functionalities.

In short, resetting a slide does more than just reapplying a layout. For
example it also sets back the formatting of placeholder shapes (e.g.
font size).

After some more testing, I'm almost certain that no "easy" Reset
function in VBA exists (but maybe I missed something...?). I helped
myself now by creating a procedure that copies the formatting of all
placeholders in the custom layout to their respective shapes objects on
the slide.

Thanks anyway for all help.


Shyam Pillai wrote:
Luca,
PPT 2007 requires a slightly different approach. All the change it needs
is to get the reference to the custom layout and it can be reapplied.
Take a look at this page.
http://skp.mvps.org/2007/ppt002.htm

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.