Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Event Handler in "Visual Basic" not vbscript

Explorer ,
May 31, 2020 May 31, 2020

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
TOPICS
Scripting , SDK
344
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation