• Creator
  • #4420

    I am using the NWDirLib ActiveX control.

    I would like to use the .Search feature, but I’m not sure how to capture the .SearchCompleted event in Formativ/VBScript. The samples given in the manual are all Visual Basic.

    Is this possible?

  • Author
  • #8134
    Support 1

    Thanks for your enquiry.

    While I don’t have a working sample available, the following should work.

    • If you have not already done so, use the Formativ Form Designer to add a form to your applet.
    • Go to the Component Palette’s Netware tab, select ‘NWDir’ and click the form surface to add this component. If your form is named ‘MainForm’, the new component name will be ‘MainFormNWDir1’.
    • Go to the Object Inspector and select the Events tab, then double-click OnSearchCompleted. This will add the following to your applet source code:
      Sub MainFormNWDir1SearchCompleted(Sender, Results)
      End Sub

    • Now add code for your application:
      Sub MainFormNWDir1SearchCompleted(Sender, Results)
        for each item in Results
          ' item is a string, the full name of an object in the Directory.
          call MainFormListBox1.Items.Add(item)
      End Sub

      This code assumes the existence of a ListBox control named ‘MainFormLIistBox1’ on the form.

    Note: If the above does not work (or if you prefer to use VBScript’s CreateObject and the control’s ProgID to create an instance of this control), it may be possible to bind a VBScript handler (ie. procedure) to the SearchCompleted event with the GetRef function.

    I hope this helps.

    Advansys Support

    [This message was edited by Support 1 on September 16, 2009 at 08:04 PM.]

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.