Insert Images Only Selected Slide.

D

Dileep

I created a Com-add ins for PowerPoint 2003 and PowerPoint 2007.when my
application runs,The PowerPoint Opens. The PowerPoint has 6 Slides now. If
i selected the 3rd slide , then images insert into 3rd and 5th Slide.But i
want to insert images only 3rd Slide only.and other slides Are Blank. I wrote
the code for this,
pptPresentation = pptApplication.ActivePresentation;
System.Windows.Forms.MessageBox.Show("Slide count in Insert
Images" + pptPresentation.Slides.Count);
//PowerPoint.Slide slide =
pptPresentation.Slides.Add(pptPresentation.Slides.Count,
PowerPoint.PpSlideLayout.ppLayoutTitle);
// Change pptPresentation.Slides.Count to
pptApplication.ActiveWindow.Selection.SlideRange.SlideNumber.
//Its For Inserting Image into a Selected Slide.
PowerPoint.Slide slide =
pptPresentation.Slides.Add(pptApplication.ActiveWindow.Selection.SlideRange.SlideNumber, PowerPoint.PpSlideLayout.ppLayoutTitle);
PowerPoint.Shape shape = slide.Shapes.Item(1);

slide.Shapes.AddPicture(@"C:\Documents and Settings\User1\My
Documents\My Pictures\nature-wallpapers-5.jpg",
Office.MsoTriState.msoFalse,
Office.MsoTriState.msoTrue,
shape.Left, shape.Top, shape.Width,
shape.Height);
slide.Shapes.Item(2).TextFrame.TextRange.Text = @"C:\Documents
and Settings\User1\My Documents\My Pictures\nature-wallpapers-5.jpg";
slide.Select();

Thanks
Dileep
 

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