Link to home
Start Free TrialLog in
Avatar of ljklinsky
ljklinsky

asked on

Accessing the VB Immediate Window using Code

I've been trying like crazy to write a procedure that will clear Visual Basic's Immediate Window.  It seems so easy, just the following steps are needed (in theory):

SendKeys "^(G)" 'Sets focus to the Immediate window.
SendKeys "^(A)" 'Selects all of the text there.
SendKeys "{DELETE} 'Deletes the selected text.

Obviously, this does not at all work in the VB environment.  Is there a way to automate this task another way?
ASKER CERTIFIED SOLUTION
Avatar of DrDelphi
DrDelphi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ljklinsky
ljklinsky

ASKER

My intention in this was to write a simple procedure/component/module that I could access at anytime within the VB environment, not just in one session.  The code you provided will certainly clear the Immediate Window in one particular program, but will not be available each time I use VB.  If I could make a custom button for the VB 6 toolbar, that would work, but I haven't found a way into that.  Though you did answer the words I wrote, I was hoping for a more global response.
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp

For experts interesting in helping the cleanup effort in their respective TAs, this link please:
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
 
Thank you,
Moondancer
Moderator @ Experts Exchange