Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SendKeys & Immediate Window (Word2000 et al.)

    <post:=31,795>post 31,795</post:>
    Back in April 2001, Kevin said I know this is an old issue, ..., and I don't have the stamina to re-open an old thread.
    Today I wondered why my utility function Public Function blnClearImmediate() As Boolean wasn't working at all, when back in 2001 I'd said (<post:=32,173>post 32,173</post:>) that it did.
    Today my first thought was "Well, Sendkeys never did work for me. Ever", but then why did I say that it did, seven years ago?
    Going back to first principles I carefully Reread The Forum Method, pasted the SUB as is, and ran it.

    It cleared my immediate window!
    Converted it to a function.
    It didn't clear my immediate window!

    What's going on here?
    Does Sendkeys work only if issued from a macro?

    Who else claims, like me, that Sendkeys doesn't? And are you able to re-test, placing your code in a macro - a Public SUBroutine with no parameters?

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

    Re: SendKeys & Immediate Window (Word2000 et al.)

    The code from <post:=32,003>post 32,003</post:> works for me both as a Sub and as a Function in Word 2002 and Excel 2002 when the Immediate window is docked, and also if the Immediate window is not dockable. If the Immediate window is dockable but not docked, it doesn't work correctly, as noted in the thread.

    The following (originally from Romke Soldaat) works for me in all situations, and both as a Sub and as a Function. Moreover, it doesn't depend on the caption of the Immediate window, so it works in non-English versions of Office too.

    Sub ClearImmediate()
    SendKeys "^g^a{del}"
    End Sub

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SendKeys & Immediate Window (Word2000 et al.)

    Thanks, Hans.
    Works for me to, once I fire up 2003.
    But back in 2001, noone had 2003 or 2002.
    I thought we were all using 97/2000.

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

    Re: SendKeys & Immediate Window (Word2000 et al.)

    I don't have Office 2000, and I don't think this problem is important enough to get my old computer with Office 97 out of the cupboard, connect everything etc.

Posting Permissions

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