![]() |
|
#1
|
|||
|
|||
|
Hi, i do have a presentation with 10 commandbuttons (ActiveX control)
i can change vi VBA the forecolor of each button but i'm wondering if there is a more efficient way to change the forecolor (or any other properties) of a commandbutton (not the shapes) via a VBA code a sort of lop that find all the buttons in the whole presentation thanks |
|
#2
|
|||
|
|||
|
hi all after a nigth spent i've found the solution
here the code Private Sub change_font() Dim pulsante As Shape Dim sld As Slide For Each sld In ActivePresentation.Slides For Each pulsante In sld.Shapes If pulsante.Name Like "CMD_*" Then pulsante.OLEFormat.Object.ForeColor = &H400040 pulsante.OLEFormat.Object.BackColor = &HFFC0C0 End If ' pulsante.ForeColor = &H400040 Next pulsante Next sld End Sub |
|
#3
|
|||
|
|||
|
I would use this to check for a command button as name like"CMD_* can fail
Sub ChangeCOMM() Dim oshp As Shape Dim osld As Slide For Each osld In ActivePresentation.Slides For Each oshp In osld.Shapes If oshp.Type = msoOLEControlObject Then If oshp.OLEFormat.ProgID = "Forms.CommandButton.1" Then oshp.OLEFormat.Object.BackColor = RGB(255, 0, 0) ' or whatever End If End If Next oshp Next osld End Sub |
|
| Tags |
| buttons, vba |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change and implement default theme font style change | Nikko963 | Word | 5 | 05-04-2018 09:11 AM |
change formula based upon change of month
|
invgrp2 | Excel | 7 | 05-03-2018 10:46 AM |
| Change computer's time, and all appointment times in Outlook's calendar change | TimTDP | Outlook | 0 | 03-14-2017 06:56 AM |
How to change save location and file to print name change?
|
albertc | Excel Programming | 1 | 05-13-2012 07:05 PM |
change the view to final, my change bars disappear. I need them visible
|
anna.a.julin | Word | 1 | 03-01-2012 08:05 PM |