Results 1 to 12 of 12
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

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

    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

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

    Re: Active Document not Active? (Windows 2000/Word 2000)

    hi Kyle,

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

  3. #3
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

    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.Pag eFit = wdPageFitBestFit

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

    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?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

    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

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

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

  7. #7
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

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

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

    Re: Active Document not Active? (Windows 2000/Word 2000)

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

  9. #9
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

    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.

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

    Re: Active Document not Active? (Windows 2000/Word 2000)

    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.

  11. #11
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Active Document not Active? (Windows 2000/Word 2000)

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

    Kyle

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

    Re: Active Document not Active? (Windows 2000/Word 2000)

    Hi Kyle and Pieter,

    Please post the outcome of your private communication in this thread. See <!rule=10>Rule 10<!/rule>. Thanks in advance <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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