Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi - can anyone help?

    I am working with PowerPoint 2007/VBA and would like to change the forecolor on a PowerPoint slide. I feel like I've tried everything but for the life of me I cannot change the color (and I just know it is going to be simple !!). I have tried the most obviously lines of code:

    sldSlide.Background.Fill.ForeColor = RGB(0, 8, 119)
    sldSlide.Background.Fill.ForeColor = Color.ForestGreen

    but no joy.

    Any ideas?

    Many thanks
    Jack21

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,896
    Thanks
    0
    Thanked 86 Times in 82 Posts
    Have you tried:
    Code:
    sldSlide.Background.Fill.ForeColor.RGB = RGB(0, 8, 119)
    Regards,
    Rory
    Microsoft MVP - Excel.

  4. #3
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Rory

    I did try that option but still unsuccessful. If I go to the immediate window and identify the background colour, then change the colour of the background the rgb is different:

    ?ActivePresentation.Slides(1).Background.Fill.Fore Color.RGB (Background Colour)
    16777215
    ?ActivePresentation.Slides(1).Background.Fill.Fore Color.RGB (Changed Background Colour)
    1525022

    I am aware that the number given is not an RGB though - not sure if that is relevant. My thinking is the same as you in that I just need a similar piece of code that sets the RGB but for the life of me I just can't find the right code.

    Regards
    Jack21

  5. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,896
    Thanks
    0
    Thanked 86 Times in 82 Posts
    Have you changed the slide's FollowMasterBackground property to msoFalse first?
    Regards,
    Rory
    Microsoft MVP - Excel.

  6. #5
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Jack21 View Post
    I am working with PowerPoint 2007/VBA and would like to change the forecolor on a PowerPoint slide. I feel like I've tried everything but for the life of me I cannot change the color (and I just know it is going to be simple !!). I have tried the most obviously lines of code:
    just because I'm curious - not because I have anything useful to offer - what are you trying to do? Edit a group of slides or provide an effect during a presentation? Tell me more?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  7. #6
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    We have a number of company specific colours that we would like the user to select, when creating a presentation. The slide is the same master it was just the colour that needed to be changed.

    I did solve this in the end:

    sldSlide.BackgroundStyle = 1

    By changing the background style you are then able to change the physical colour of the background.

    Regards
    Jack21

  8. #7
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Jack21 View Post
    We have a number of company specific colours that we would like the user to select, when creating a presentation. The slide is the same master it was just the colour that needed to be changed.

    I did solve this in the end:

    sldSlide.BackgroundStyle = 1

    By changing the background style you are then able to change the physical colour of the background.

    Regards
    Jack21
    This is in addition to using a PPT Template and themes?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •