i'm trying to insert a new, blank slide into an existing
Powerpoint, but I have the problem that the slide is just
inserted at the end of the ppt. I want that the new, blank
slide has to inserted after the current slide I'm actually
using.
for example:
I have a ppt with 20 slides and I'm working aktually in
slide no. 12 and now start my makro. So the new slide
should be inserted after slide 12 and not after slide 20.
My VBA-code look like this:
ActiveWindow.View.GotoSlide _
Index:=ActivePresentation.Slides.Add _
(ActivePresentation.Slides.Count + 1, _
Layout:=ppLayoutBlank).SlideIndex
What's wrong with my Code?
Thanx and many greeting
Berkan
ActiveWindow.View.GotoSlide _
Index:=ActivePresentation.Slides.Add _
(ActiveWindow.View.Slide.SlideIndex + 1, _
Layout:=ppLayoutBlank).SlideIndex
Regards
Shyam Pillai
Shyam's ToolBox
http://www.mvps.org/skp/toolbox
"Berkan" <a...@berkan.de> wrote in message
news:4f7101c1b94e$8eb07080$39ef2ecf@TKMSFTNGXA08...
--
DO NOT POST ATTACHMENTS IN THIS NEWSGROUP
Michael Koerner [MS PPT MVP]
Got a PowerPoint wish/suggestion/beef?
Email msw...@microsoft.com with PowerPoint in the subject line
"Berkan" <a...@berkan.de> wrote in message news:4f7101c1b94e$8eb07080$39ef2ecf@TKMSFTNGXA08...
Try this macro
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(ActiveWindow.Selection.SlideRange.Slide
Number + 1, Layout:=ppLayoutBlank).SlideIndex
I think ActivePresentation.Count will return the total number of slides and
hence you are adding at the last position.
Regds
Bhaskar Reddy.
---SNIP---
Hi,
---SNIP---
' Breaking it down into several steps because it's easier to understand:
Dim CurrentSlide as Long
' Get the index of the slide we're on now
CurrentSlide = ActivePresentation.Windows(1).View.Slide.SlideIndex
' Add a new slide right after it
ActivePresentation.Slides.Add Index:=CurrentSlide + 1, Layout:=ppLayoutTitle
' or whatever you like
; Go to the new slide
ActiveWindow.View.GoToSlide(CurrentSlide + 1)
--
If you attach a file, I'll never see your message. Please don't.
Steve Rindsberg, PowerPoint MVP
Email your PowerPoint suggestions to msw...@microsoft.com
Get the PPT FAQs at http://www.rdpslides.com/pptfaq/
RnR PPTools - http://www.pptools.com
------
Berkan <a...@berkan.de> wrote in message
news:4f7101c1b94e$8eb07080$39ef2ecf@TKMSFTNGXA08...
I'd guess that the code Berkan posted was part of a larger thingie.
You can't do larger thingies with Ctrl+M. ;-)
--
DO NOT POST ATTACHMENTS IN THIS NEWSGROUP
Michael Koerner [MS PPT MVP]
Got a PowerPoint wish/suggestion/beef?
Email msw...@microsoft.com with PowerPoint in the subject line
"Steve Rindsberg" <stop...@its.source> wrote in message news:e3bE3PXuBHA.2112@tkmsftngp05...
You know more than you think, you see?
Exactly so.
But it's normal to post just snippets that illustrate the problem you're
having, chopped out of what might be a much larger wad of code. He may have
been doing something vastly more complex. Continental coastlines, fjords
and fiddly bits and all, enough to make the mice proud, you see, when along
comes this Vogon coder and ...
Have I got the plots all mixed up again?
"Steve Rindsberg" <stop...@its.source> wrote in message news:#hB9EPcuBHA.1892@tkmsftngp03...