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:how to download microsoft office 2003

A:Open your browser and navigate to http://www.brothersoft.com/microsoft-office-2003-169273.html To download Microsoft office 2003, click green...(more)

Q:where i can get product key for Microsoft office 2007 standard?

A:Sharing a product key is not allowed in this QA community. this abused the rule. The QA community manager will remove the product key answer b...(more)

Q:Hello, My hard disk was demmaged I installed a new one, altough my data on the old one is still to be opend, can i reinstall my office program from the old drive to the new ?
Q:Hello, My hard disk was demmaged and I installed a new one, altough my data on the old one is still to be opend, can i reinstall my office program from the old drive to the new ?

A: jghjygu utyd mu

Q:Despite paid avira and windows defender has been infected bad. Ther are folders for "printhood" and "nethood" . Ran a scan last night,/4 adware and now it is 1000 tines worse.

A:You should only have one anti virus/ malware on your machine as they can block each other.  Reinstall your Avira software direct from the...(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

×