Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure if this is the answer you want to hear, but development in PowerPoint with VBA is actually good. I do quite a bit of it (as well as Word and Excel) and it is robust enough. The PowerPoint OM that can be programmed against with VBA is updated with each of the new versions of PPT. In PPT 2007, you can create Custom XML against <em>any</em> object on a slide - far more powerful than options available in Excel and Word. In contrast, Word 2007 has Content Controls, which, in order for PPT to be some kind Crystal Reports light-weight replacement, it would benefit from. In PPT 2010 (beta), you can programmatically create SmartArt, for example, as you can with Word/Excel 2010. You can also programmatically work with media elements better than before. VSTO, from an OM perspective, doesn't offer a whole lot more than VBA though.</p> <p>It may just depend on your needs though - do you create standard bullet slides? Do you do extended animation? Do you do reporting? Are you creating eLearning "apps"? If you have specific questions on the OM, we can try to help you here (but maybe the feature just doesn't exist).</p> <p>Agreed that removing the macro recorder kind of sucked, that was a useful feature. Directly working with the PML/DML is also a pain. There are things that I wish the OM did support as well. But in concurrence with caving, I don't believe VBA is going away any time soon.</p> <hr> <p><strong>NOTE</strong>: <strong>THIS DOES NOT WORK</strong>. IT IS PROVIDED ONLY AS A STARTING POINT IF FOLKS WANT TO TRY TO DEVELOP THIS INTO SOMETHING THAT MAY WORK (<em>if you can get it to work, please feel free to edit this post</em>).</p> <ol> <li>Create a class called "clsPPTEvents"</li> <li><p>Paste in the following code.</p> <pre><code>Public WithEvents PPTEvent As Application Private Declare Function GetCursorPos Lib "user32" (ByVal lpPoint As POINTAPI) As Long Private Type POINTAPI x As Long y As Long End Type Dim ret As Long Dim mousePosition As POINTAPI Private Sub PPTEvent_WindowSelectionChange(ByVal Sel As Selection) Dim ElementID As Long Dim Arg1 As Long Dim Arg2 As Long With Sel If .Type = ppSelectionShapes Then Dim sr As ShapeRange sr = .ShapeRange If sr.Type = msoChart Then Dim sh As Shape Dim slideNumber As Integer slideNumber = ActiveWindow.View.Slide.SlideIndex sh = ActivePresentation.Slides(slideNumber).Shapes(sr.Name) Dim crt As Chart crt = sh.Chart H = ActiveWindow.Height w = ActiveWindow.Width ret = GetCursorPos(mousePosition) x = mousePosition.x y = mousePosition.y crt.GetChartElement(x, y, ElementID, Arg1, Arg2) MsgBox("X: " &amp; x &amp; ", Y: " &amp; y &amp; vbNewLine &amp; _ "ElementID: " &amp; ElementID &amp; ", Arg1: " &amp; Arg1 &amp; ", Arg2: " &amp; Arg2) End If End If End With End Sub </code></pre></li> <li><p>In a regular module, you can start/stop the event handling with this:</p> <pre><code>Public newPPTEvents As New clsPPTEvents Sub StartEvents() Set newPPTEvents.PPTEvent = Application End Sub Sub EndEvents() Set newPPTEvents.PPTEvent = Nothing End Sub </code></pre></li> </ol> <p>Note that in the code in #2, it doesn't work because of what GetCursorPos returns, which is the screen X, Y. In looking at event, it appears that what the GetChartElement wants is either the Window or Pane bounding box's coordinates or just the chart's itself.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload