Can anyone tell me how to implement the following in "Visual Basic" not vbscript?
"GetRef" doesn't work in "Visual Basic"
== This is a code provided in the InDesign Scripting SDK ===
Set myDocument = myInDesign.Documents.Add
myDocument.AddEventListener "afterSelectionChanged", GetRef("myDisplaySelectionType")
Function myDisplaySelectionType(en)
Set myInDesign = CreateObject("InDesign.Application.2020")
If myInDesign.Documents.Count > 0 Then
if myInDesign.Documents.Item(1).Selection.Count > 0 Then
Set mySelection = myInDesign.Documents.Item(1).Selection
myString = "Selection Contents:" & vbCr
for myCounter = 1 To mySelection.Count
myString = myString & TypeName(mySelection.Item(myCounter)) & vbCr
Next
MsgBox(myString)
End If
End If
End Function
==========================
Thanks,
Tak