Results 1 to 15 of 15
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dialog capture (2000 sp-3/ 98SE)

    I suspect that what I'm wanting to do is not easy or even possible, but here goes.

    I've been looking at some of the built-in dialogs in Word e.g. wdDialogFileOpen, and would like to be able to capture the contents of the controls. For instance, enumerate the items in a listbox in the dialog window. I suspect that these dialogs are subclasses of their own variety, since none of the API "tricks" I know will distinguish any of the controls - the whole dialog appears to be one big control.

    I can't make head nor tail of the argument lists shown in the VBA help file either, so they are of little use. Maybe there exists some better documentation? If anyone has any bright ideas, I'd appreciate some hints.

    Alan

  2. #2
    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: Dialog capture (2000 sp-3/ 98SE)

    It probably is easier to build your own list or use Windows controls that to try to read the file list from the FileOpen dialog.

    Most of the parameters are well explained in WordBasic reference books, but if you don't have any, the information might be hard to find. Here, I'll hold mine up to the screen for you. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Thanks for the info Jefferson. I don't have access to any WordBasic books, but I will have an online search.

    My example was probably not the best one for my purposes. One particular thing I'd like to do is to grab a list (delimited text say) of all the macro names for the active document, or for "All active templates and documents". I don't know how I'd go about building the equivalent of the wdToolsMacro dialog box. Would it be at all possible?

    Alan

  4. #4
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    You can download the Word95 WordBasic help file.
    The current Word VBA help file also has a list of arguments for the built-in dialogs... The WordBasic help file is still very useful to see of what type those arguments are, and what the allowed values are.

    You can stuff a list of the active documents and/or templates and/or macros in a user form list box.
    But I'm still not sure what you want to do, or what you have problems with...

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Hi Klaus

    Thanks for that reference. It's the kind of thing I was after, but I don't think the sort of functionality I'm after is there. What I'm trying to do is to try to knock up a sort of "extended" doc properties utility. I want to be able to enumerate all the styles, autoxexts etc. in a particular document or template. I've managed to extract all the styles properties for presentation in an expandable tree view. The autotexts is coming along, but enumerating a list of macros in or attached to the document, and their dialogbox "properties" e.g. Description, is proving elusive.

    Alan

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Perhaps you know already... just in case:

    The VBA watch window is great to find out how to get at such info (and what's available).

    Just write a simple macro like<pre>Dim myDoc As Document
    Set myDoc = ActiveDocument
    </pre>

    , right-click on myDoc and set a watch for it. Then single-step over those two lines, and see what's available from myDoc in the Watch window's tree.

    To open the VBProject branch, you may have to go to "Tools > Macro > Security", second tab, and trust access to the VB Project.
    I haven't worked with this much... You may only get at the complete macro module, and have to parse that yourself for individual macro names and descriptions.

    The Word help menu, Info > System Info > Office > Word has also pretty much info on the active document (styles...).

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  7. #7
    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: Dialog capture (2000 sp-3/ 98SE)

    Oh, I think we had a thread on this where we could not find a way to do it without using the VBA Extensibility stuff. But I can't find it in a search, so I guess it could be false deja vu. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  8. #8
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    WoW! I hadn't realized the wealth of information on the document object in the Watch window. It appears (as you predicted) that it only goes as deep as Module Name though. It still remains a problem to find the individual macro details.

    I'd forgotten about the System Info... in the Help menu. There's a lot there too, but it's superfluous to what I've already managed to do. I guess I could save and parse it, but I think my existing methods are better for my purpose. And again, no macro information.

    The only place I've seen a nice summary of the macros is in that wdDialogToolsMacro dialog. I'll continue my hunt. Thanks for all the info Klaus.

    Alan

  9. #9
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Tallahassee, Florida, USA
    Posts
    901
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Hi Allan -- I think This MS KB Article 262961 may put you on the right track. As Jefferson recalled, you will need to reference the Microsoft Visual Basic for Applications Extensibility.

    Good luck!
    Karen

  10. #10
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    If it's <post#=7045>post 7045</post#> you're thinking of, I'm not surprised your deja vu is a bit rusty - a 4-digit post #... true nostalgia! But that's put me on the right track, followed up nicely by Karen's post (see my reply to that).

    cheers
    Alan

  11. #11
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Karen, you're a winner! This is exactly what I was after. I'd sniffed out the general idea in <post#=7045>post 7045</post#>, but your reference has sealed it nicely. I'd scoured MSDN for something like this, but obviously I was looking in the wrong place. Many thanks.

    Alan

  12. #12
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Some time ago I too was struggling with something like this, so Karen's link is just like hitting the jackpot!
    Attached is a text file with a Sub that's basically the one in that KB article, but dressed up a bit to suit my needs a little more.
    Attached Files Attached Files

  13. #13
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Thanks Jan. I've also concocted my own incarnation for the specific needs of this project, but I'll have a good look at yours too.

    Alan

  14. #14
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    A procedure-lister has been on my "to do" list for a while, and this thread was the kick-in-the-butt that I needed.

    Attached is my variation. It jumps from procedure to procedure (rather than testing every line in a module), distinguishes among Property Get, Let and Set procedures, and opens a closed project if that's all that's keeping it locked.
    Attached Files Attached Files

  15. #15
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dialog capture (2000 sp-3/ 98SE)

    Sounds like good stuff Steve (I presume 3333=e). It might help <img src=/w3timages/censored.gif alt=censored border=0>-kick me into trying to wrap this thing up. I've been asked to do this as a kind of extended document summary utility. I'll post back to the forum when I get something worthwhile. Thanks for the input.

    Alan

Posting Permissions

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