none
PowerPoint 2010 VSTO: save and reapply colorscheme to current slide RRS feed

  • Question

  • Dear all,

    In my VSTO add-in for PowerPoint 2010 I want to save the current colorscheme and reapply it after applying a different design. The user may want that different design but doesn't want the current color scheme changed.

    I have tried and searched. Somehow I keep running into dead ends:

                For i = 1 To mySelection.SlideRange.Count
                    myColorobject = mySelection.SlideRange(i).ThemeColorScheme.Colors(1)
                    'myColorObject = mySelection.SlideRange(i).ColorScheme.
                    mySelection.SlideRange(i).ApplyTheme(myFilename)
                    mySelection.SlideRange(i).ColorScheme.Colors(1) = myColorobject
                Next
    

    No matter if I make myColorobject a Themecolorscheme or a color -> I always hit a read-only property. How can I solve this?

    Alternatively: How can I get a name of the themecolorscheme applied to the current slide? Or which code can I use to accomplish my ends? Please.

    Monday, May 7, 2012 2:31 PM

Answers

  • Hi BirgitA,

    Thanks for posting in the MSDN Forum.

    I noticed that ThemeColorScheme has Load method to load customized ThemeColorScheme and Save method to save customized ThemenColorScheme. I'm wondering whether it is you want.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by BirgitA Monday, May 14, 2012 1:07 PM
    Tuesday, May 8, 2012 8:00 AM
    Moderator

All replies

  • Hi BirgitA,

    Thanks for posting in the MSDN Forum.

    I noticed that ThemeColorScheme has Load method to load customized ThemeColorScheme and Save method to save customized ThemenColorScheme. I'm wondering whether it is you want.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by BirgitA Monday, May 14, 2012 1:07 PM
    Tuesday, May 8, 2012 8:00 AM
    Moderator
  • Thank you for your quick answer.

    It could be a possibility. I believe the load and save would save the scheme to the disk from where I could load it again. Seems a bit wasteful though. I only need to store it temporarily in a variable.

    I'll try this as soon as possible (priorities just shifted a lot)

    Cheers, Birgit

    Tuesday, May 8, 2012 8:24 PM
  • Hi BirgitA,

    Any Update?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 14, 2012 11:55 AM
    Moderator
  • Hi Tom,

    yes, I ran a quick test just now and it indeed saves the current colors to disk and I can load them again. Nice thing is that the file will be overwritten without notice, so I can keep reusing the same filename. Thus at the end of the operation only one file needs to be removed from the system.

    Thank you very much.

    Cheers, Birgit

    Monday, May 14, 2012 1:07 PM