Link to home
Start Free TrialLog in
Avatar of Nirvana
NirvanaFlag for India

asked on

custom colors in powerpoint 2013

can you please help me i have couple powerpoint macros

Q1. How can i have a macro to change colors with a button for example

I will have radio buttons and when select shape or textbox and click on the radio button it has to pick the colors of the button. Hope i am clear. i have tried with below code however i am not able to add it to a radio button
Private Sub ColorCircle()
With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(255, 102, 0)
.Fill.Solid
End With
End Sub

Open in new window


Q2. A macro to change the table to standard format for example headings should be bold and font should be calibri, font color should be RGB 87,87,87 header background should be RGB 255,87,0 and finally table should have the size as height 0.41"and width 6.67"
Presentation2.pptx
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)
Flag of United Kingdom of Great Britain and Northern Ireland image

Where is your radio button, on a slide or a form? The Sub is declared as Private so it will not appear in the list of macros (Alt+F8 or Insert/Action) if you are trying to assign it to an on-slide object (shape, control etc.) so declare as Public instead.
Avatar of Shabbir Rao
Shabbir Rao

I think Jamie above is absolutely right. And you can check it this thing by doing it manually and check out the macros than.
Avatar of Nirvana

ASKER

sorry i have not got it. basically what i want to do is if i select anything (could be shape, table, text box etc.,) and when i click on radio button it should select a particular color. how can i do that
Where is the radio button? Slide or Form? If on a slide, anyone using the pptm file may face verbose ActiveX security messages so if possible, I would always assign the macro to a standard PowerPoint shape via Insert / Action / Mouse Click / Run macro.
Avatar of Nirvana

ASKER

can we create a form if when clicked a button in the form the color gets changed to the item selected?
Avatar of Nirvana

ASKER

basically what we have is company published colors fonts etc. so preparing slides and change colors to those standards is taking loads of time
If you're trying to manage the brand for multiple users, I would recommend purchasing an add-in that does this for you and I just happen to work for a company that has such a tool:

http://youpresent.co.uk/office-add-ins/swiftprez/http://youpresent.co.uk/office-add-ins/swiftprez/

There's also a video of the tool in use with one of our partners:

http://buffalo7.co.uk/present-assist-windows/

If you want to develop something yourself, then you probably also need to consider an add-in and in this case, I would suggest developing the controls in a custom ribbon tab. But this is far more detailed that your initial question. They key question is "how will you deploy the solution?". As an add-in or within a macro-enabled deck (.pptm).
Avatar of Nirvana

ASKER

Thanks Jamie, the addin you have suggested i exactly what i am looking for (may be not all features) but need to check how can i get permission to install a tool

yesI need the solution as an addin
OK. So if you want to develop yourself, the simplest way forward is to create an application add-in (.PPAM) via these high level steps:

  1. create a PPTM project
  2. create the UI in the XML of the PPTM
  3. add the macro code triggered by the UI in the PPTM
  4. save the project as a PPAM and deploy it to all users
Avatar of Nirvana

ASKER

sure Jamie, thank you. can you please let me know if there is details step step documentation somewhere to do the mentioned steps?
For the development process, it's a case of having a good VBA book on hand plus referring to MSDN but this is a good start for ribbon development:

https://msdn.microsoft.com/en-us/library/aa338202.aspx

If you need a custom add-in development then that's a service our company can provide too.
Avatar of Nirvana

ASKER

Thanks Jamie. will try with the resources that you have provided. and a personal question whats the best way to learn VBA?
ASKER CERTIFIED SOLUTION
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nirvana

ASKER

Thank you so much. really appreciate your help
Avatar of Nirvana

ASKER

Jamie Ribbon demo is brilliant, how can I add colors in the add-in
To add colours:

1. Edit the XML in the PPTM file to add new ribbon controls using tools such as Visual Studio or Custom UI Editor.
2. Edit the VBA in the PPTM (using the VBE) to handle the callbacks from the new controls.