Re: In slide edit, click an image to run a VBA routine

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In addition to what Steve said. If you are using the event handling approach then

- Keep the event handling code to the minimum.
- Turn the event handling off while you are processing the event and reset it back when done.
- You may run into an issue where the shape will move around as you move your cursor after the macro is done running. To work around this either unselect the shape programmatically or switch views and restore back.

Regards,
Shyam Pillai

Animation Carbon - http://www.animationcarbon.com





"Steve Rindsberg" <abuse@xxxxxxxxxxxxx> wrote in message news:VA.00004642.4d23cae0@xxxxxxxxxxxxxxxx
In article <B6757F32-BC96-4473-A35D-C72E868DB20F@xxxxxxxxxxxxx>, Lars wrote:
I must develop a VBA routine that will open a user form when I click on any
one of several images on an existing slide (not the Slide Master), while in
edit mode. The user form allows me to select another image from a folder and,
when validating by OK, replaces the picture in the image control by the new
one. VBA code attached to an image control runs when in SlideView mode but
not in Edit mode. Can anyone give me some pointers ? Any help will be MOST
appreciated !

To expand on John's suggestion, you'll want to create an add-in that adds a menu
item or toolbar/buttons; when you choose these to invoke your code, it would
work on the current selection to do what you're after.

You'd want it to do some validation first ... make sure that there's only one
shape selected, that it's the correct type of shape and so on.

Another approach would be to write an add-in that implements an event handler:

Make PPT respond to events
http://www.pptfaq.com/FAQ00004.htm

You could respond to the SelectionChanged event; do nothing if the current
selection isn't one of your "target" shapes, or invoke your form and run your
code if it is.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



.



Relevant Pages

  • Re: In slide edit, click an image to run a VBA routine
    ... Thanks Steve, for your suggestions. ... appear if the PowerPoint template is run on another PC. ... replaces the picture in the image control by the new ... work on the current selection to do what you're after. ...
    (microsoft.public.powerpoint)
  • RE: convert lookup column from access to sql server express
    ... You have a code that represents two people (Matt & Steve). ... When you make the selection where is that selection stored and what are you ... lookup table with possible values and for each account ...
    (microsoft.public.access.forms)
  • Re: Unable to print Emails in Outlook Express
    ... I do not have regsvr on my system, ... a window opens for a printer selection and a print ... If you select format memo (to select the printing of the ... "Steve Cochran" schreef: ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: transparent text or group names
    ... event handler (that handles the selection event, ... slide all called "steve" in 2003 ... Then I changed some shapes so that eg the circle called "steve" became a ...
    (microsoft.public.powerpoint)