Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Pennsylvania, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Allowing user interaction during macro execution (Word 2000)

    I'm creating resumes by having employees interact with a macro that accepts input for various parts of the resume and then creates the document. For resumes that already exist, they can modify existing sections.

    PROBLEM: I can give them the option to print the resume for inspection, but I can't find a way to allow them to VIEW the resume from within the macro. There doesn't seem to be a way to minimize or hide the userform and give the focus to the open document so that they can scroll through it, even if in Read-Only mode.

    I'd appreciate any guidance in accomplishing this. Thanks in advance.

  2. #2
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Long Beach, California, USA
    Posts
    233
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allowing user interaction during macro execution (Word 2000)

    this will open up the print preview window.

    ActiveDocument.PrintPreview

    I am not sure if this would help.

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

    Re: Allowing user interaction during macro execution (Word 2000)

    Larry,

    Another thing to look at is making the userform non-modal (you can do this starting with Word 2000) - that way the users can shuttle back and forth between your userform and the document (similar to how Word dialogs like Find and Insert Symbol work). - I love non-modal userforms! <img src=/S/love.gif border=0 alt=love width=15 height=15>

    To set the userform to non-modal, set the ShowModal property to False.

    Gary

  4. #4
    Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Pennsylvania, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allowing user interaction during macro execution (Word 2000)

    Gary, thanks for the suggestion.

    I've tried this approach, but my code seems to "drop through" the modeless dialog after I show it. (I don't want this entire application to run modelessly (now there's a word) ... only this single feature.

    I'm obviously missing something basic here. Are there a few steps for beginners in the modeless world that might help?

    (By the way, the Print Preview suggestion did not work for me.)

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

    Re: Allowing user interaction during macro execution (Word 2000)

    Larry,

    Sorry but I'm a bit stuck for further suggestions - I don't think you're missing anything basic - as long as a macro is running or a modal userform is showing, it's hard to see how you can give control over the Word document back to the user temporarily.

    If your userform could be purely modeless then it might be possible to get it to work (not sure what you mean by the code 'dropping through').

    I don't know of any instructions on getting modeless userforms to work; I've had to work things out via trial and error. What's appealing about them is that they do give you the ability to create something like an application (or more commonly, some sort of tool that you use interactively with Word) that runs at the same time that Word is running, and allows users to shuttle back and forth between Word and the userform's "application".

    Gary

  6. #6
    Star Lounger
    Join Date
    Sep 2001
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allowing user interaction during macro execution (Word 2000)

    You might try to insert a "preview" button into your dialog, which simply hides the dialog and enables a toolbar button, which will again show the dialog.

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allowing user interaction during macro execution (Word 2000)

    If using Word 8, or later, you can make the Userform MOdeless. Does not work on MACinTOSH.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allowing user interaction during macro execution (Word 2000)

    Using Modeless requires redesigning yor algorithms so, in effect, no code is executed outside of the control of the Userform.

    See the example in the VBA Code Snippets template at my URL.

Posting Permissions

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