[VBA] 取得Shape Group中的文字



贊助商連結


leonchou
2003-05-03, 04:10 PM
提供參考 --
1.UNGROUP
With ActiveSheet.Shapes("Group 20").Ungroup
MsgBox ActiveSheet.Shapes("Name1").TextFrame.Characters.Text '方式1
MsgBox ActiveSheet.Shapes(4).TextFrame.Characters.Text '方式2
MsgBox .Item(2).TextFrame.Characters.Text '方式3
.Regroup.Select
End With
 
2.不用UNGROUP
MsgBox ActiveSheet.Shapes(3).GroupItems(2).TextFrame.Characters.Text

PS."據說"第2種不適用Office XP, 有用XP的人不妨試試.

如果不清楚什麼是Shape Group, 可參考下圖.