Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    How to show File/Properties dialog box? (Office XP, Word 2002)

    Can someone guide me to how to write VBA code to open the File/Properties dialog box.

    I can only find the argument wdDialogFileSummaryInfo.

    I have tried code: Dialogs(wdDialogFileSummaryInfo).Show

    But this dialog box does not contain the text box for Category.

    Thanks in advance!

    Bjorn

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

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    I don't know if this will be of any help, but from the Word 2000 VBA Help file under the topic "Storing values when a macro ends":

    To access built-in properties, use the BuiltInDocumentProperties property to return a DocumentProperties collection that includes the built-in document properties. Use the CustomDocumentProperties property to return a DocumentProperties collection that includes the custom document properties. The following example creates a custom document property named "YourName" in the same location as the macro that is running (document or template).

    ThisDocument.CustomDocumentProperties.Add Name:="YourName", _
    LinkToContent:=False, Value:="Joe", Type:=msoPropertyTypeString
    Built-in document properties cannot be added to the DocumentProperties collection returned by the BuiltInDocumentProperties property. You can, however, retrieve the contents of a built-in document property or change the value of a read/write built-in document property.

    Note You can use the DOCPROPERTY field to insert document properties into a document.

    Alan

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    hi Bjorn,

    Application.Run MacroName:="FileProperties"

    is the only possible way i believe.

    greetings,

  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: How to show File/Properties dialog box? (Office XP, Word 2002)

    Or you need to use the constant 750 for the Dialog, which MS forgot in the list of wdDialog constants:

    <pre> Application.EnableCancelKey = wdCancelDisabled
    Dialogs(750).Show
    Application.EnableCancelKey = wdCancelInterrupt</pre>


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

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    hi Klaus,

    aha now that's interesting! do you have by any chance a complete listing of dialogs for which there is not a corresponding dialog constant.
    for instance
    - the edit find dialog, but with all tabs enabled?
    - the add watermark dialog (format->background->printed watermark...)
    - ....

    i'm running the numbers right now but they haven't come up yet.

    greetings,

  6. #6
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    In W2K it is not even in the Dialogs collection.

    This is what I did:

    Dim dlg As Dialog

    For Each dlg In Dialogs
    If dlg.Type = 750 Then
    Stop
    End If
    Next

    and it didn't stop.

    However if I use what you posted Dialogs(750).Show, then there it is.

    And I second pieters request, do you have a complete list?
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  7. #7
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    hi Bryan,

    that seems logical. the dialog collection only contains thos dialogs for which there's a dialogconstant.
    in the mean time i'm running a loop which displays all dialogs and crashed word several times already in the process.
    it has come up with the strangest things (launching office application, help, showing tooltips, displaying a splash screen for MS schedule+ (!)), but the dialognumbers for the dialogs mentioned in previous mail remain elusive... <img src=/S/blackhole.gif border=0 alt=blackhole width=15 height=15>

    greetings

  8. #8
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    Actually to me it doesn't seem logical that it isn't in the Dialogs collection.

    The wdDialog constants are just that, constants.

    But when you use Dialogs(750).Show to display the FileProperties Dialog you are accessing a Dialog with the Index # of 750 in the Dialogs collection.

    It just doesn't make sense to me.

    Oh wait, it's just another MSism that we have come to know, <img src=/S/love.gif border=0 alt=love width=15 height=15> and work around <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    Do you just need a way to programmatically open the dialogs?

    Edit | Find:

    commandbars.FindControl(ID:=141).Execute

    WaterMark:

    commandbars.FindControl(ID:=4003).Execute
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  10. #10
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    Thanks a lot It works!

    Like that it was encountered for the Cancel key.

    Bjorn

  11. #11
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    Thanks Pieter, it works!

    I also tried what Klaus Linke posted. This is also working.

    I'm not an experienced VBA coder so, Q:

    What would be the code for disabling the Cancel key when "Application.Run MacroName:="FileProperties"" are used?

    Bjorn

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

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    Hi Pieter,

    > - the edit find dialog, but with all tabs enabled?
    > - the add watermark dialog (format->background->printed watermark...)

    I would use Kevin's method. Some dialogs simply don't work as you would expect, but the commandbar controls seem to always work fine.

    Probably CommandBars.FindControl(ID:=someID).Execute really does exactly the same as choosing the corresponding toolbar button or menu item.

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

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

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    > it has come up with the strangest things

    Hi Pieter,

    Yes, there seems to be a dialog constant for just about every command.

    Some things you can try:
    Select some text, then
    Dialogs(46).Show
    will make it italic.
    Dialogs(248).Show
    will apply the "Normal" style.

    I have a long list with such stuff, but since you can do all these things in other more transparent ways, it's more of a curiosity.

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

  14. #14
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    thanks Kevin and Klaus,

    somehow i was temporarily unaware of the findcontrole().execute statement. your posts proved an excellent reminder!

    greetings,

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

    Re: How to show File/Properties dialog box? (Office XP, Word 2002)

    Hi Bjorn,

    > What would be the code for disabling the Cancel key when "Application.Run MacroName:="FileProperties"" are used?

    You could use Application.EnableCancelKey the same way.
    Many times you'll see "On error resume next" when dialogs are displayed, but I think disabling the Esc key is neater.

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

Page 1 of 2 12 LastLast

Posting Permissions

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