Brothersoft.comWindows|Mac|Mobile|Games

|Message

Solve software problem quickly Share experience to help others Improve the ability of solving problem
How do you change a picture in a share to a different picture in VBA powerpoint?

02/16/2012 08:22 by wawaslope

First answer posted by JavyTechGuy at 02/16/2012 08:23
Add Your Answer
10~1000 characters in length CAPTCHA:
3 Answers
  • JavyTechGuy
  • Do you wish to determine if the shape type is picture or if the fill is a picture?
    This works for a shape which contains a picture.
    Dim shp As Shape
    Set shp = ActivePresentation.Slides(1).Shapes(1)
    If shp.Fill.Type = msoFillPicture Then
        Call shp.Fill.UserPicture("C:\Users\Pictures\tulips.jpg")
    End If
  • Was this answer helpful? 00 · 02/16/2012 08:23
  • NataliaPeterson
  • Here is what I try.  I had already changed the macro it to compensate for that
    What I am trying to do is change the logo on all of my master in a presentation. I do this by highlighting the logo shape and run this macro
    Sub ChangeLogo()
        Dim shp As Shape
        ActiveWindow.Selection.ShapeRange.Name = "Logo"
        Set shp = ActiveWindow.Selection.ShapeRange("Logo")
        If shp.Fill.Type = -2 Then
            Call shp.Fill.UserPicture("C:\My Documents\Powerpoint\2011\Images\Logo.png")
        End If
        End Sub
    Unfortunately what is does is add the second logo to the shape
  • Was this answer helpful? 00 · 02/16/2012 08:23
  • Kimplex
  • Try instead:
     
    Sub ChangeLogo()
        Dim shp As Shape
        Set shp = ActiveWindow.Selection.ShapeRange(1)
        ' -2 is Mixed; if you're changing a picture fill,, you want 6
        If shp.Fill.Type = 6 Then
            Call shp.Fill.UserPicture("C:\My Documents\Powerpoint\2011\Images\Logo.png")
        End If
    End Sub
    If that doesn't change the picture fill, add:
    MsgBox shp.Fill.Type
    after End If to see what type fill you actually have.
    Another approach would be simply to insert a picture shape in the first place, have your macro delete it and add a different picture.
  • Was this answer helpful? 00 · 02/16/2012 08:24
Add Your Answer
10~1000 characters in length CAPTCHA:
Related Questions
Q:my previous pc broken, need to activate my valid microsoft office 2007 on a new pc. I have a valid key product

A:the numbers of pc validation not allowed. I want only to replace it. the previous pc out of order.

Q:Audio fade-out function is not working well in PPT 2010

A:The fade in / out option only works on a single slide not across slides.

Q:How to print more than one slide per page?

A:you could use the print > Handouts feature

Q:How do you open .ppt files created by PowerPoint 2000 with ms office 2007?

A:I have the same problem. presentation files made by ms office PowerPoint 97 cannot open in ms office PowerPoint 2007.(more)

Q:How can I add music throughout the presentation in powerpoint 2007?

A:Add music to the presentation in powerpoint 2007: In the pane that contains the Outline and Slides tabs, click the Slides tab. Click th...(more)

Added Successfully!

×

Are you sure to delete your answer?

NoYes

×

Are you sure to choose it as the best answer?

NoYes

×

Voted Successfully!

×

You can't vote for yourself

×

You can't choose your own answer

×