Activating an open instance of Word without opening a new instance

L

Larry

Assuming that Word is already open, but not active, is there a way to
activate Word without opening a new instance of Word? Sometimes I have
a bunch of open applications, and I don't want to go through five
applications in the Alt+Tab bar to get to Word, I'd like to use a single
shortcut (triggered by a .vbs file) to activate Word in one step.

I do this with Outlook Express. I have a shortcut that opens Outlook
Express, but if OE is already open (either minimized or not) and not
active, running that shortcut simply makes OE active. I'd like to be
able to do the same with Word.

Word 97, Windows 98.

Thanks,
larry
 
J

Jim Eshelman

Larry said:
Assuming that Word is already open, but not active, is there a way to
activate Word without opening a new instance of Word? Sometimes I
have a bunch of open applications, and I don't want to go through five
applications in the Alt+Tab bar to get to Word, I'd like to use a
single shortcut (triggered by a .vbs file) to activate Word in one
step.

Why not click the taskbar item? That brings up the active instance with one
click to something that is always visible (unless you go out of your way to
hide it).

--
Jim Eshelman, MS-MVP Windows
http://aumha.org/
http://WinSupportCenter.com/

Did you find this newsgroup on the web? A newsreader like Outlook Express
will make your online life a lot easier. Get better help!
See: http://aumha.org/nntp.htm and
http://support.microsoft.com/support/news/howto/default.asp
 
J

Jezebel

Set MyWord = GetObject("Word.Application")

Returns an active instance if there is one; fails if there is not.
 
L

Larry

Did you actually think I didn't know that I can click on the Taskbar
button? What I'm looking for here is a keyboard way of doing this with
one step, via a shortcut that I run with a Winkey assignment.

Larry
 
J

Jim Eshelman

Larry said:
Did you actually think I didn't know that I can click on the Taskbar
button? What I'm looking for here is a keyboard way of doing this with
one step, via a shortcut that I run with a Winkey assignment.

Ah. That wasn't evident. Sorry. Your use of "shortcut" led me to believe you
wanted a single desktop item to click. You meant "shortcut keystroke" rather
than "shortcut." Got it.
 
J

Jezebel

No. The usual structure is something along these lines --

'Get existing instance if any
on error resume next
Set MyWord = GetObject("Word.Application")
on error goto 0

'No existing instance so create a new instance
if MyWord is nothing then
Set MyWord = CreateObject("Word.Application")
end if
 
L

Larry

I'm sorry for seeming thick here, but what you're giving me is a Word
macro. In order to run the macro, I would have to have Word active so
that I could press the assigned keystroke or click the menu button to
run the macro. But in the scenario I'm talking about, Word is one of
many open Windows on the desktop; Word is not active and I want it to
become active. My idea is to run parameters (which I could try out in
the Run dialog box,and then put in a .vbs file run via a Winkey
assignment) which would activate any open instance of Word.

Larry
 
J

Jezebel

This code will run in VB or VBScript so you can put it directly in your vbs
file.

I don't understand what you mean by 'run parameters' -- anything you put
into the Run dialog has to be executable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top