Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Hidden VB Form (VBA/Word/2000)

    I have a lengthy macro--time-wise--that the users were inclined to deem as having crashed. To overcome this I introduced a status/progress bar which works well providing another application isn't using the screen area intended for the status bar. I don't like the idea of requiring the user to precondition the system prior to runing the macro, yet am unable to figure out how to either minimize all applications other than Word, or preferrably cause the form to be always on top. In case that my current coding might be influencing the situation, the scheme is:
    v1AcronymFinder.Acronym_Main calls Missed_Acronyms.Main
    Missed_Acronyms.Main contains the line MissedAcronymsForm.Show
    MissedAcronymsForm calls MissedAcronyms2.MissedAcronyms
    MissedAcronyms2.MissedAcronyms contains the following code:
    <pre> With MissedAcronymsForm
    .Label1 = "Potential Missed Acronyms."
    .FrameProgress.Caption = Format(PctDone, "0%")
    .LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
    End With
    Application.ScreenRefresh
    DoEvents
    LastPctDone = PctDone
    </pre>


    Any insight would be most appreciated.
    Regards
    Don

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hidden VB Form (VBA/Word/2000)

    There's not much you can do if the user deliberately activates another application. It's not considered polite to let your dialog stay on top of other applications, with very few exceptions.

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hidden VB Form (VBA/Word/2000)

    Hans
    Thanks for the etiquette comment. Your input convinced me to introduce a message box immediately prior to loading the form, to advise the user that they may need to clear part of the screen to see the progress bar. In doing this I discovered the following:

    In Word 2000 on Windows 2000 The message box appeared on top of any application which happened to be open, and on closing the message box the progress form appeared on top. The user still had the ability to bring the other application to the fore, hiding the progress form. This is almost the exact the performance that I want; I would prefer that it not be necessary for the user to respond to a message box.

    In Word 2003 on Windows XP The message box is partially or completely hidden by any application that happens to be occupying the centre of the screen. This results in the process appearing to hang with no reason apparent to the user. I would like to emulate the Word 2000 performance.

    Any thoughts will be most welcome.
    Regards
    Don

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hidden VB Form (VBA/Word/2000)

    Microsoft changed the behavior of message boxes in Windows XP on purpose. If a background application wants to have the focus, its button in the task bar will flash a few times. This can be changed using TweakUI for Windows XP, but it is a user setting, so you cannot count on users having done that.

    As an alternative, you could put a message in Word's status bar. Nobody will read it, but at least, you would have done your best... <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hidden VB Form (VBA/Word/2000)

    Thanks for the in-depth response Hans. I am going to end up doing just as you suggested; though it is a little like stating, "I'm glad the hole's not in my end of the boat." <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>
    Regards
    Don

Posting Permissions

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