Publisher (的 Cell.HasText 屬性)
會傳回 Boolean 值,指出指定的儲存格是否包含任何文字。 如果指定的儲存格包含文字會傳回 True 。 唯讀。
語法
運算式。HasText
表達 代表 Cell 物件的變數。
範例
如果第一頁的第一個圖案包含表格,而表格的第一個儲存格包含文字,則本範例會在訊息方塊中顯示文字。
With ActiveDocument.Pages(1).Shapes(1)
' Check for table.
If .HasTable Then
With .Table.Cells(StartRow:=1, StartColumn:=1, _
EndRow:=1, EndColumn:=1).Item(1)
' Check for text in first cell.
If .HasText Then
MsgBox "Text from first cell of table: " _
& vbCr & .Text
Else
MsgBox "No text in first cell."
End If
End With
Else
MsgBox "No table in shape one."
End If
End With
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。