Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jan 2001
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Obtaining control ID from dialog (Word 97)

    Hi,

    when opening a mailmerge document whose datasource file cannot be found, Word displays a dialog offering two choices. Choosing the second ("Options") another dialog pops up, again offering two choices. The class identifier of both the dialogs is "bosa_sdm_Microsoft Word 8.0", their heading "Microsoft Word". But although they each contain text and two buttons, I cannot retrieve any hwnd or ctlID for these controls.

    As the dialogs appear before the Open- or AutoOpen-events, I want to remote-control them by Sendkeys from another application, and in order to make sure it is the right dialog to react on check the contents of it's textbox. Is Word "hiding" the controls by subclassing? Is there any means to retrieve the dialog's text?

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Obtaining control ID from dialog (Word 97)

    Martin,

    My (limited) understanding of this issue is that it's not possible to return handles or control IDs on the components of any built-in Word dialogs - are you saying that you are able to do so with some Word dialogs but not these ones? (or are these the only ones you've tried it on?).

    There is some ability to get at the Word built-in dialogs via the wdDialogs collection (see VBA help topic "Built-in dialog argument lists") but as has been demonstrated here before, there are many things that these don't allow you to get to either. Still, that's one place to look.

    It would be worthwhile posting this question on the VB/VBA forum - perhaps someone has dealt with this issue while working with an Office app other than Word.

    Gary

  3. #3
    Lounger
    Join Date
    Jan 2001
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Obtaining control ID from dialog (Word 97)

    Hi Gary,

    thanks for your reply. In Fact it is the first and only time I tried this with a Word dialog, but I just checked now with the "Insert special characters" dialog and found that it reveals some of its control handles, but not all of them.
    I will follow your advice and post the question in VBA.

    Martin

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Obtaining control ID from dialog (Word 97)

    You can follow this thread further here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •