Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# and Power Point

C# and Power Point

Scheduled Pinned Locked Moved C#
csharphelpquestiondiscussion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PDTUM
    wrote on last edited by
    #1

    Hello, This may be more of a PowerPoint issue that a C# one, but I thought I would try it this way since I cannot find a PowerPoint solution for this. I have written a C# application that calls PowerPoint slides from a menu. I would like to know if there is a way to randomly change the background of each PowerPoint slide that is called by selecting the graphic from a list of possibles. I cannot find a way to do this in PowerPoint alone and I wondered if there was a way to have C# do it for me; or perhaps if there is another solution? Thanks for your thoughts....Best, Pat

    P 1 Reply Last reply
    0
    • P PDTUM

      Hello, This may be more of a PowerPoint issue that a C# one, but I thought I would try it this way since I cannot find a PowerPoint solution for this. I have written a C# application that calls PowerPoint slides from a menu. I would like to know if there is a way to randomly change the background of each PowerPoint slide that is called by selecting the graphic from a list of possibles. I cannot find a way to do this in PowerPoint alone and I wondered if there was a way to have C# do it for me; or perhaps if there is another solution? Thanks for your thoughts....Best, Pat

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You are right. This is nothing at all to do with C#. I would suggest that a possible solution would be to use VBA to randomly choose the background and apply it.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      P W 2 Replies Last reply
      0
      • P Pete OHanlon

        You are right. This is nothing at all to do with C#. I would suggest that a possible solution would be to use VBA to randomly choose the background and apply it.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        P Offline
        P Offline
        PDTUM
        wrote on last edited by
        #3

        Ok Pete....just did not know where to turn on this one so I took a shot. The good news is that your suggestion worked; I was able to modify some VBA code I found and make it work along the following lines (even though I have never written a word in VB before): Public Sub ChangeBackgrounds() 'Global array to store pic names Dim PictureList(1 To 10) As String 'List of pictures - in same directory as ppt: PictureList(1) = "pic1.JPG" PictureList(2) = "pic2.JPG" PictureList(3) = "pic3.JPG" PictureList(4) = "pic4.JPG" PictureList(5) = "pic5.JPG" PictureList(6) = "pic6.JPG" PictureList(7) = "pic7.JPG" PictureList(8) = "pic8.JPG" PictureList(9) = "pic9.JPG" PictureList(10) = "pic10.JPG" 'Define a slide Dim mySlide As Slide 'Iterate through every slide in the presentation For Each mySlide In ActivePresentation.Slides.Range Dim PictureChoice 'Give us a random number between 1 and 10 as PictureChoice PictureChoice = Int((20 * Rnd) + 1) ' Don't follow the master background style mySlide.FollowMasterBackground = msoFalse mySlide.Background.Fill.UserPicture (PictureList(PictureChoice)) 'Use our random number to choose a picture from the list Next mySlide End Sub Thanks...Pat

        1 Reply Last reply
        0
        • P Pete OHanlon

          You are right. This is nothing at all to do with C#. I would suggest that a possible solution would be to use VBA to randomly choose the background and apply it.

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          W Offline
          W Offline
          wizardzz
          wrote on last edited by
          #4

          :thumbsup: good advice!

          Craigslist Troll: litaly@comcast.net "I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups