共用方式為


PowerPoint) (Cell.Selected 屬性

如果選取指定的表格儲存格會傳回 True 。 唯讀。

語法

運算式選擇

表達 代表 Cell 物件的變數。

傳回值

布林值

範例

如果選取指定表格的第一個儲存格,則本範例會在此儲存格四周加上框線。

Sub IsCellSelected()

    Dim celSelected As Cell

    Set celSelected = ActivePresentation.Slides(1).Shapes(1) _
        .Table.Columns(1).Cells(1)

    If celSelected.Selected Then
        With celSelected
            .Borders(ppBorderTop).DashStyle = msoLineRoundDot
            .Borders(ppBorderBottom).DashStyle = msoLineRoundDot
            .Borders(ppBorderLeft).DashStyle = msoLineRoundDot
            .Borders(ppBorderRight).DashStyle = msoLineRoundDot
        End With
    End If

End Sub

另請參閱

Cell 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應