Results 1 to 10 of 10
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    NAME of a dialog

    How do I get to learn the NAME of a dialog?

    I know that there is a VBA constant that identifies it by type, but say I want to pop-up the dialog for defining a character style. Where in the name of help do I find the definition of the constant identifier?


    The sample code below merely proves that the Type is an integer value.

    Examination of the dlg object provides no clue as to the true identity of the dlg object.


    <pre> Dim i As Integer
    For i = 1 To Dialogs.Count
    Dim dlg As Dialog
    Set dlg = Dialogs(i)
    On Error Resume Next
    With dlg
    Debug.Print .Type
    End With
    Next i
    End Sub
    </pre>


  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NAME of a dialog

    Chris,

    Check for the list of constants which can be downloaded <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q112/6/71.asp>here</A>.


    That will give be, in Excel for example, a list of constants "xlDialog..."; if I sort that block by number, I can find the dialog name.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

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

    Re: NAME of a dialog

    There's no help available to provide definitions for the Dialog constants. For the most part, they're pretty self-explanatory, no?

    BTW you can get the type index number for each constant in the Object Browser - just select one of the members of 'WdWordDialog' and the constant name and index will be displayed at the bottom - all constants have an integer value.

    Steven Roman's book on Word macros is particularly good for listing Word constants along with their index number.

    And maybe this can occasion another raging debate: my understanding is that it's better practice to refer to constants by their name rather than their index number (since the index number could at some future point change).

  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: NAME of a dialog

    This might not help matters, since I have not checked whether .Type is the same as the wdConstants listed in online help, but it does return a very interesting list. Also, when I get to the FileRoutingSlip dialog, my Outlook profile selection dialog pops up (Outlook is closed!), which makes no darned sense at all!!

    Note: make sure you have a blank document active, as I omitted to create one dedicated to the task.

    Sub EnumDlgs()
    Dim dlg As Dialog
    For Each dlg In Dialogs
    ActiveDocument.Range.InsertAfter dlg.Type & " = " & dlg.CommandName & vbCrLf
    Next
    End Sub

    For added fun, you can pop the dialogs by selecting the number in the above-created list and invoking this macro (needs a keystroke assignment):

    Sub PopOne()
    Dialogs(Val(Selection.Text)).Show
    End Sub

    Just in case this does not run in Word97, I attach my results from Word2000.
    Attached Files Attached Files

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NAME of a dialog

    > dlg.CommandName

    Not available in Word97SR2, I find. I bet that's because they realised the mistake in not having it in Word97!




    >182 FormatDefineStylePara

    Thanks. This will do for now. I'm glad that you were thoughtful enough to attach the DOC.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NAME of a dialog

    > it's better practice to refer to constants by their name ra


    Oh, I'm close to rage already.

    I agree with your principles. It beggars (is the nice word) my imagination as to why the Help files have to be so OBTUSE at times.

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

    Re: NAME of a dialog

    It greaves me so to see you in such pain...<g>
    (did you know Paul Simon?)

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NAME of a dialog

    > Check for the list of constants which can be downloaded here.

    Thanks Geoff. After I d/l it I found I already had a copy! I HAVE to get organised ....

  9. #9
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NAME of a dialog

    Yeah, Chris, I thought you might have had it.

    I found the url again when I posted by doing a search in the forum- I found it by a reply to one of your earlier posts <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NAME of a dialog

    > I found it by a reply to one of your earlier posts

    Curses. And RECurses!

Posting Permissions

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