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

Event Handler in "Visual Basic" not vbscript

Explorer ,
May 31, 2020 May 31, 2020

Copy link to clipboard

Copied

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

Views

271

Translate

Translate

Report

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