• Active Document not Active? (Windows 2000/Word 2000)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Active Document not Active? (Windows 2000/Word 2000)

    Author
    Topic
    #394439

    Hello All,

    I have a macro that I’ve been working on for a while now that basically pastes a document as unformatted text, and reapplies formatting, footnotes, everything. I’m using the Range property to copy paragraphs and everywhere else. Toward the end if the macro I’m closing old document, reopening it (invisible to end-user) and evaluating more formats.

    The problem is when the macro is done, my new document is not active. I’ve set my ranges to nothing, told new document to activate, but nothing works. I can see the document, but can’t type, use arrows. Word just beeps at me. My toolbars are not active either. If I click another document or application on the task bar and come back to my new document, then it becomes active.

    Any suggestions?

    Thanks,

    Kyle Knowles
    Connetics Corporation

    Viewing 3 reply threads
    Author
    Replies
    • #723024

      hi Kyle,

      dim Newdoc as document
      set newdoc=documents.add
      ‘…
      ‘…
      newdoc.activate
      application.activate

      • #723222

        Hi Pieter. Thanks for the response. I added this to my code but now I’m getting error message: 4601 Application Cannot be Activated.

        Here is my code:

        oNewTemplate.Activate
        Application.Activate
        oNewTemplate.ActiveWindow.View = wdPrintView
        oNewTemplate.ActiveWindow.Selection.HomeKey Unit:=wdStory
        oNewTemplate.ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit

        • #723554

          Is it possible that there is a modal dialog box in the application that is hidden from view? Are you running Nortons AntiVirus as this has an option setting that causes dialogs to be hidden until you move away and then back to the application?

          • #724908

            Hi Andrew.

            Sorry it took so long to respond. For some reason my password was reset on the Lounge and I had to go and look it up again. We are running Symantec and my dialog is not supposed to be hidden.

            Kyle

          • #724909

            Hi Andrew.

            Sorry it took so long to respond. For some reason my password was reset on the Lounge and I had to go and look it up again. We are running Symantec and my dialog is not supposed to be hidden.

            Kyle

        • #723555

          Is it possible that there is a modal dialog box in the application that is hidden from view? Are you running Nortons AntiVirus as this has an option setting that causes dialogs to be hidden until you move away and then back to the application?

      • #723223

        Hi Pieter. Thanks for the response. I added this to my code but now I’m getting error message: 4601 Application Cannot be Activated.

        Here is my code:

        oNewTemplate.Activate
        Application.Activate
        oNewTemplate.ActiveWindow.View = wdPrintView
        oNewTemplate.ActiveWindow.Selection.HomeKey Unit:=wdStory
        oNewTemplate.ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit

    • #723025

      hi Kyle,

      dim Newdoc as document
      set newdoc=documents.add
      ‘…
      ‘…
      newdoc.activate
      application.activate

    • #724910

      Are you sure the invisible document is closed at that time?

      • #725008

        Yes, I’m closing the old document a few steps back.

        • #725348

          we’ll need to see the full code this time i think if we want to solve the problem.

          • #725781

            Well, it’s a huge piece. I’m begining to think that my template is corrupt. Things that should work will only work when I step through the code.

            • #725905

              hi Kyle,

              you can try and download the word code cleaner
              recomplie after that, save and close and relaunch word.
              also check you have no missing references.
              if you are working with a userform, the activate problem might be a word 2000 specific bug, which i will not abe able to reproduce because i’m using 2002.

              if you still experience problems after that, you can send the template to me personally if you want in case it contains confidential information. or trim it down to code that only demonstrates the problem.

            • #726186

              Ok Pieter I will send it to you along with my test document. Thank you so much.

              Kyle

            • #726218

              Hi Kyle and Pieter,

              Please post the outcome of your private communication in this thread. See Rule 10. Thanks in advance smile

            • #726219

              Hi Kyle and Pieter,

              Please post the outcome of your private communication in this thread. See Rule 10. Thanks in advance smile

            • #726187

              Ok Pieter I will send it to you along with my test document. Thank you so much.

              Kyle

            • #725906

              hi Kyle,

              you can try and download the word code cleaner
              recomplie after that, save and close and relaunch word.
              also check you have no missing references.
              if you are working with a userform, the activate problem might be a word 2000 specific bug, which i will not abe able to reproduce because i’m using 2002.

              if you still experience problems after that, you can send the template to me personally if you want in case it contains confidential information. or trim it down to code that only demonstrates the problem.

          • #725782

            Well, it’s a huge piece. I’m begining to think that my template is corrupt. Things that should work will only work when I step through the code.

        • #725349

          we’ll need to see the full code this time i think if we want to solve the problem.

      • #725009

        Yes, I’m closing the old document a few steps back.

    • #724911

      Are you sure the invisible document is closed at that time?

    Viewing 3 reply threads
    Reply To: Active Document not Active? (Windows 2000/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: