12.2.5 Item Labels

I am struggling to get the new Item.Labels function to work. I am sure it is my basic ignorance of VB that is the problem. I have written this code to extract the names of the labels attached to an image displayed in the Viewer separated by semi-colons

dim k: set k = clickData.func.viewer.current For Each label In k.Item.Labels If (labelString <> "") Then labelString = labelString & "; " labelString = labelString & label Else labelString = label End If Next

It gives the error

Object doesn't support this property or method: 'k.Item' (0x800a01b6)

What am I missing, please?

Viewer.current returns an Item.

So, on the second line, k is already an Item and k.Item doesn't make sense.

Just remove the ".Item" from the second line.

Many thanks, Leo