How to copy a shape from a PPT and insert it into current PPT,VBA?

R

Robert

Hi,
We use PPT files to keep some logos ( each files has one or two small
slides 3†X 4†and each slide has a combination of textbox , autoshapes and
pictures that make a logo) . I want to write a macro to copy that logo(
basically everything in slide 1) and paste it in my current presentation. I
know how to write the code to find the directory and file name ( I have
added a combobox to a userform which shows all the PPT logo files in my
computer) but I don’t know how to open that file , copy the logo , close it
,and then paste it into my current presentation\slide . Any help will be
greatly appreciated.
 
S

Shyam Pillai

Robert,
Here is the basic macro:

Sub Macro()
Dim oPresWithLogo As Presentation

Set oPresWithLogo = Application.Presentations.Open("F:\Logo\logo.ppt", True,
False, msoFalse)
'Assuming that the logo shapes are on the 1st slide
' copy all the shapes.
oPresWithLogo.Slides(1).Shapes.Range.Copy

'Paste the shapes on the 1st slide of the active presentation.
ActivePresentation.Slides(1).Shapes.Paste

oPresWithLogo.Close
Set oPresWithLogo = Nothing
End Sub

--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 

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