• Allowing user interaction during macro execution (Word 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Allowing user interaction during macro execution (Word 2000)

    Author
    Topic
    #365104

    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.

    Viewing 3 reply threads
    Author
    Replies
    • #562632

      this will open up the print preview window.

      ActiveDocument.PrintPreview

      I am not sure if this would help.

    • #562650

      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! love

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

      Gary

      • #562946

        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.)

        • #563037

          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

        • #563636

          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.

    • #563604

      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.

    • #563634

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

    Viewing 3 reply threads
    Reply To: Allowing user interaction during macro execution (Word 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: