I am trying to use VBA and C# to determine the selected range of cells in a PowerPoint table. Ideally, I could use something like the .Start and .End properties of the selected range of cells to identify the row and column boundaries of the selected range of cells, but I could find no such properties.
But I cannot find any way to get the cell coordinates from the selection object. I want to use something like this:
var startColumn = selection.ShapeRange.Table.<selected cellrange>.Start;
The only thing I found that was even close was some code that looped over each cell in the selected table object asking if each cell was selected.
For x = 1 To oTbl.Rows.Count
For y = 1 To oTbl.Columns.Count
If oTbl.Cell(x, y).Selected Then
' do something with the selected cell or indexes
End If
Next
Next
Is that the only way for me to determine the row and column of the selected cell, or is there a shorter way? Thank you.
@Steve Rindsberg confirmed that PowerPoint has no functions for this sort of thing. I used the code shown above to traverse the table cells to find the selected region.