none
PowerPoint: WindowBeforeDoubleclick event not firing in Normal View

All replies

  • Hi Cindy,

    Thanks for posting in the MSDN Forum.

     I will consult Microsoft's engineers for it. Let's see whether they can give some explain. There might be some time delay, appreciate for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Tuesday, December 04, 2012 1:49 AM
    Moderator
  • Hi Cindy,

    I was able to reproduce your results directly in PowerPoint 2007 and 2010 using VBA code and was able to verified that the issue you’re experiencing is due to a known bug that is currently under investigation. Unfortunately I do not have a timeframe on when this may be addressed.

    I am sorry for the inconvenience this is causing you.

    Can you explain what are you trying to accomplish and why using the selection change event is not an option?

    My only other suggestion would be to implement a customized context menu as demonstrated here.

    XML:
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <!--WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS EXAMPLE IS -->
    <!--AT YOUR OWN RISK. Microsoft provides this macro code "as is" without -->
    <!--warranty of any kind, either express or implied, including but not limited -->
    <!--to the implied warranties of merchantability and/or fitness for a particular purpose. -->
     <contextMenus>
       <contextMenu idMso="ContextMenuGraphicOleClassic">
         <menu idMso="EditOleObjectMenu" getVisible="GetVisibleNative"></menu>
           <menu id="OurCustomEditObject" getVisible="GetVisibleCustom" label="Object Actions">
              <button id="MyButton2" label="Open" onAction="ClickOLEOpen" />
           </menu>
         </contextMenu>
      </contextMenus>
    </customUI>

    VBA:
    Option Explicit
    'WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS EXAMPLE IS
    'AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of
    'any kind, either express or implied, including but not limited to the implied warranties of
    'merchantability and/or fitness for a particular purpose.

    Sub ClickOLEOpen()
        MsgBox "Hello"
        ActiveWindow.Selection.SlideRange.Shapes(3).OLEFormat.DoVerb (1)
    End Sub

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, December 06, 2012 10:11 PM
  • Hi Donald

    Thank you for the reply, information and concern :-)

    My Add-in targets 2007 and 2010 (and 2013, although not yet thoroughly tested), so the context menu approach isn't possible (not supported by PowerPoint in 2007).

    In my VSTO Add-in scenario I'm having to work-around another "dysfunctionality" in PowerPoint: it doesn't provide an idMso for the tool to draw free-hand curves (Insert/Illustrations/Shapes/Curve). With some help from the PowerPoint specialists who hang out in the "Communities" forum, I was able to work around this by calling an old CommandBarsButton ID. But that tool doesn't draw curves, it draws a series of straight lines.

    The purpose of my add-in is to make it EASIER for the user to create certain types of diagrams, so I'm putting the tools used for these diagrams in a Custom Task Pane so that they're closer and so that the user doesn't continually need to navigate various Ribbon tabs. Since the whole idea is to make things EASIER, it would make no sense to tell the user he then needs to "edit points" and change each point from "corner" to "smooth". Thus, I require code to perform the task.

    The next question is: how to trigger the task. Again, I don't want the user to have to perform any additional action. Drawing a freehand Shape finishes by double-clicking, so that was the obvious choice of event as a trigger. I could simply set a global variable (bool) when drawing starts, check for that value in the event, and perform the necessary action.

    In the meantime (a day or so after posting), I have figured out how to solve it using WindowSelectionChange. But the required code is more complex than BeforeDoubleClick would have been because the user triggers it continually as he clicks to set the nodes...


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, December 07, 2012 12:52 PM
    Moderator
  • Hi Cindy,

    I am tryipng to achieve a similar thing. It would be of great help if you could post sample code of your workaround.

    Thanks and regards,

    Shwetal Mehta

    Tuesday, February 19, 2013 7:48 AM
  •         void Application_WindowSelectionChange(PowerPoint.Selection Sel)
            {
                if (inDrawingMode && Sel.Type == PowerPoint.PpSelectionType.ppSelectionShapes)
                {
                    inDrawingMode = false;
                    PowerPoint.Shape shp = Sel.ShapeRange[1];
                    if (shp.Type == Office.MsoShapeType.msoFreeform) //USER HAS JUST DRAWN A FREEFORM SHAPE
                    {
                        for (int n = shp.Nodes.Count; n >= 1; n--)
                        {
                            shp.Nodes.SetEditingType(n, Office.MsoEditingType.msoEditingSmooth);
                            shp.Nodes.SetSegmentType(n, Office.MsoSegmentType.msoSegmentCurve);
                        }
                    }
                }
            }


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 20, 2013 8:10 AM
    Moderator
  • @Donald M - Microsoft : How do you implement this ?

    Btw, why is the OLE always that different from behaviour than the rest of the shapes ?

    I would like to catch a DoubleClick / SelectionChange event on an OLE object, but I cannot find any help.

    Anybody could give me a suggestion ?

    Wednesday, June 05, 2013 1:58 PM