Consulting

Results 1 to 2 of 2

Thread: Image Gallery Ribbon *HELP PLEASE*

  1. #1
    VBAX Newbie
    Joined
    Apr 2013
    Posts
    1
    Location

    Question Image Gallery Ribbon *HELP PLEASE*

    Hello,

    Please help...

    I would like to select one image at a time from the image gallery and insert it on my PowerPoint slide. At the current time, when I select an image from the gallery, it inserts them all.

    XML Code using Custom UI Editor:
    [vba]
    <customUI xmlns="schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="false">
    <tabs>
    <tab id="BDOeLearningResourcesTab" label="BDO eLearning Resources">
    <!--Colour Palette-->
    <group id="Group1" label="BDO Colour Palette - REFERENCE ONLY!">
    <button id="CustomButton1" label="BDO Red" size="large" onAction="bdored" image="bdored"/>
    <button id="CustomButton2" label="Coral" size="large" onAction="bdocoral" image="bdocoral"/>
    <button id="CustomButton3" label="Burgundy" size="large" onAction="bdoburgundy" image="bdoburgundy"/>
    <button id="CustomButton4" label="Teal" size="large" onAction="bdoteal" image="bdoteal"/>
    <button id="CustomButton5" label="Teal 40%" size="large" onAction="bdoteal40" image="bdoteal40"/>
    <button id="CustomButton6" label="Grey" size="large" onAction="bdogrey" image="bdogrey" />
    <button id="CustomButton7" label="Grey 40%" size="large" onAction="bdogrey40" image="bdogrey40"/>
    <button id="CustomButton8" label="Yellow" size="large" onAction="bdoyellow" image="bdoyellow"/>
    <button id="CustomButton9" label="Yellow 40%" size="large" onAction="bdoyellow40" image="bdoyellow40"/>
    <button id="CustomButton10" label="Blue" size="large" onAction="bdoblue" image="bdoblue"/>
    <button id="CustomButton11" label="Blue 40%" size="large" onAction="bdoblue40" image="bdoblue40"/>
    </group>
    <!--Gallery-->
    <group id="Group2" label="Photo Gallery">
    <gallery id="Gallery1" label="BDO Authorized Images" imageMso="HeaderFooterPictureInsert" onAction="ClickImage" columns="5" rows="3" itemWidth="100" showItemLabel="false" itemHeight="100" size="large">
    <item id="pic1" image="array_of_tools" label="Array of Tools"/>
    <item id="pic2" image="caliper" label="Caliper"/>
    <item id="pic3" image="chain_with_red_link" label="Picture 3"/>
    <item id="pic4" image="china_wall" label="Picture 4"/>
    <item id="pic5" image="circle_of_arms" label="Picture 5"/>
    <item id="pic6" image="coins" label="Picture 6"/>
    <item id="pic7" image="crossing_escalators" label="Picture 1"/>
    <item id="pic8" image="elephants" label="Picture 2"/>
    <item id="pic9" image="glass_roofed_building" label="Picture 3"/>
    <item id="pic10" image="globe_with_yellow_helmet" label="Picture 4"/>
    <item id="pic11" image="globes" label="Picture 5"/>
    <item id="pic12" image="guages" label="Picture 6"/>
    <item id="pic13" image="jumping_helmets" label="Picture 1"/>
    <item id="pic14" image="laptop_and_newspaper" label="Picture 2"/>
    <item id="pic15" image="laptop_with_USB_cable" label="Picture 3"/>
    <item id="pic16" image="laying_paving_stones" label="Picture 4"/>
    <item id="pic17" image="lion_door_knockers" label="Picture 5"/>
    <item id="pic18" image="man_and_laptop" label="Picture 6"/>
    <item id="pic19" image="man_and_woman_discussing" label="Picture 1"/>
    <item id="pic20" image="man_and_woman_reflected_laptops" label="Picture 2"/>
    <item id="pic21" image="man_measuring" label="Picture 3"/>
    <item id="pic22" image="mountains_and_chinese_roof" label="Picture 4"/>
    <item id="pic23" image="parasols_at_the_beach" label="Picture 5"/>
    <item id="pic24" image="passing_the_baton" label="Picture 6"/>
    <item id="pic25" image="people_looking_at_the_sky" label="Picture 6"/>
    <item id="pic26" image="pulling_two_suitcases" label="Picture 1"/>
    <item id="pic27" image="red_fans" label="Picture 2"/>
    <item id="pic28" image="red_reflected_globe" label="Picture 3"/>
    <item id="pic29" image="red_tower_of_people" label="Picture 4"/>
    <item id="pic30" image="seven_suited_persons" label="Picture 5"/>
    <item id="pic31" image="shirts_and_ties" label="Picture 6"/>
    <item id="pic32" image="stepping_stones" label="Picture 1"/>
    <item id="pic33" image="suit_with_tools_in_pocket" label="Picture 2"/>
    <item id="pic34" image="suited_man_with_toolbox" label="Picture 3"/>
    <item id="pic35" image="tennis_balls" label="Picture 4"/>
    <item id="pic36" image="three_handheld_globes" label="Picture 5"/>
    <item id="pic37" image="three_mobile_phones_and_subway" label="Picture 6"/>
    <item id="pic38" image="three_people_and_globe" label="Picture 1"/>
    <item id="pic39" image="two_birds_and_skyscrapers" label="Picture 2"/>
    <item id="pic40" image="two_business_men" label="Picture 3"/>
    <item id="pic41" image="two_flying_swans" label="Picture 4"/>
    <item id="pic42" image="two_men_and_plans" label="Picture 5"/>
    <item id="pic43" image="two_men_reflected" label="Picture 6"/>
    <item id="pic44" image="two_microscopes" label="Picture 1"/>
    <item id="pic45" image="two_red_umbrellas" label="Picture 2"/>
    <item id="pic46" image="two_smiling_men_and_skyscraper" label="Picture 3"/>
    <item id="pic47" image="two_suited_men_looking" label="Picture 4"/>
    <item id="pic48" image="two_swimming_swans" label="Picture 5"/>
    <item id="pic49" image="two_women_and_chairs" label="Picture 6"/>
    <item id="pic50" image="typing_on_laptop_x2" label="Picture 6"/>
    <item id="pic51" image="violins" label="Picture 6"/>
    </gallery>
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>
    [/vba]


    VBA Code in PowerPoint Presentation:
    [vba]
    'Callback for CustomButton1 onAction
    Sub bdored(control As IRibbonControl)
    MsgBox "BDO RED - R237, G26, B59"
    End Sub
    'Callback for CustomButton2 onAction
    Sub bdocoral(control As IRibbonControl)
    MsgBox "BDO CORAL - R246, G161, B168"

    End Sub
    'Callback for CustomButton3 onAction
    Sub bdoburgundy(control As IRibbonControl)
    MsgBox "BDO BURGUNDY - R152, G0, B46"
    End Sub
    'Callback for CustomButton4 onAction
    Sub bdoteal(control As IRibbonControl)
    MsgBox "BDO TEAL - R46, G176, B164"
    End Sub
    'Callback for CustomButton5 onAction
    Sub bdoteal40(control As IRibbonControl)
    MsgBox "BDO TEAL 40% - R46, G176, B164"
    End Sub
    'Callback for CustomButton6 onAction
    Sub bdogrey(control As IRibbonControl)
    MsgBox "BDO GREY - R120, G104, B96"
    End Sub
    'Callback for CustomButton7 onAction
    Sub bdogrey40(control As IRibbonControl)
    MsgBox "BDO GREY 40% - R120, G104, B96"
    End Sub
    'Callback for CustomButton8 onAction
    Sub bdoyellow(control As IRibbonControl)
    MsgBox "BDO YELLOW - R255, G227, B156"
    End Sub
    'Callback for CustomButton9 onAction
    Sub bdoyellow40(control As IRibbonControl)
    MsgBox "BDO YELLOW 40% - R255, G227, B156"
    End Sub
    'Callback for CustomButton10 onAction
    Sub bdoblue(control As IRibbonControl)
    MsgBox "BDO BLUE - R34, G64, B154"
    End Sub
    'Callback for CustomButton11 onAction
    Sub bdoblue40(control As IRibbonControl)
    MsgBox "BDO RED - R34, G64, B154"
    End Sub
    'Callback for Gallery1 onAction
    Sub ClickImage(control As IRibbonControl, id As String, index As Integer)
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\array_of_tools.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\caliper.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\chain_with_red_link.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\china_wall.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\circle_of_arms.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\coins.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\crossing_escalators.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\elephants.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\glass_roofed_building.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\globe_with_yellow_helmet.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\globes.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\guages.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\jumping_helmets.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\laptop_and_newspaper.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\laptop_with_USB_cable.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\laying_paving_stones.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\lion_door_knockers.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\man_and_laptop.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\man_and_woman_discussing.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\man_and_woman_reflected_laptops.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\man_measuring.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\mountains_and_chinese_roof.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\parasols_at_the_beach.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\passing_the_baton.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\people_looking_at_the_sky.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\pulling_two_suitcases.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\red_fans.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\red_reflected_globe.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\red_tower_of_people.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\seven_suited_persons.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\shirts_and_ties.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\stepping_stones.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\suit_with_tools_in_pocket.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\suited_man_with_toolbox.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\tennis_balls.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\three_handheld_globes.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\three_mobile_phones_and_subway.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\three_people_and_globe.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_birds_and_skyscrapers.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_business_men.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_flying_swans.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_men_and_plans.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_men_reflected.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_microscopes.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_red_umbrellas.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_smiling_men_and_skyscraper.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_suited_men_looking.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_swimming_swans.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\two_women_and_chairs.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\typing_on_laptop_x2.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="path to my image files\violins.png", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=100, Top:=100).Select
    End Sub
    [/vba]

    Thank you in advance.
    Paul
    Last edited by pfiggy; 04-19-2013 at 07:09 AM.

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    I think the ClickImage callback just needs to check the value of index and then load the appropriate image rather than loading all of them.
    Be as you wish to seem

Posting Permissions

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