Activating the open Word instance with a shortcut and hotkey

L

Larry

A while ago I was looking for a way to activate the open Word 97
application in one step when there are a bunch of open windows on
screen, without having to go through Alt+Tab or picking up the mouse to
click on the taskbar. I wanted to be able to activate Word with a
single keystroke, even if there were ten open windows on screen. There
seemed to be no way to do it, since the various command line switches
for opening Word, if run from either the Run dialog or from a .vbs file
(activated by Winkey) would open a new instance of Word rather than
activate the current instance. But then I found out tonight that a
regular Windows shortcut to the Normal template does it:

"C:\Program Files\Microsoft Office\Templates\Normal.dot"

This activates the present instance of Word while opening a new blank
document. This was not ideal, as I want to activate Word as is, without
opening a new document. Then I assigned a hotkey to the shortcut, and
guess what? When I run the hotkey, Word is activated, WITHOUT OPENING A
NEW DOCUMENT. This is bizarre, I don't understand how this could
happen, yet it's exactly what I wanted.
Any explanations? I'm not complaining, :) but I'd like to know how
this works.

I'm working in Windows 98.

Larry
 
G

Gary S. Terhune

Nope, can't explain it. I believe there is, in VBA, (and in VBS/WSH?) a Window.Activate method, but in your case...

Curious... What happens when you *already* have two instances of Word open and use the Hotkey?
 
L

Larry

I tried it with two instances of Word open. It still works, and it
always activates one of the instances (in this case, the one that was
open first), not the other instance.

Another neat thing about this. The activation of the Word window when I
press the hotkey is instananeous, noticeably faster than when I use
Alt+Tab.

What I'm describing sounds impossible (that the shortcut opens a new
document while activating Word if I click on the shortcut, but that it
does not open a new document while activiating Word if I run the
shortcut with a hotkey). But that's what's happening.

Larry




Nope, can't explain it. I believe there is, in VBA, (and in VBS/WSH?) a
Window.Activate method, but in your case...

Curious... What happens when you *already* have two instances of Word
open and use the Hotkey?
 
S

Suzanne S. Barnhill

The hotkey summons the app from wherever it is (opens it if closed, makes it
the active window if already open). I believe this was true back to Windows
3.1. You will note similar behavior in the MRU list at the bottom of the
File menu. If you absent-mindedly click on a document that's already open,
it doesn't (at least in recent versions) fool around with trying to open a
copy or asking if you want to revert to saved; it just brings that document
window to the front, same as if you'd clicked on the Taskbar button.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
L

Larry

I know the hotkey summons the ap, but the question here is, why when I
click on the shortcut icon, it summons the ap AND opens a new document,
but when I press the hotkey, it summons and ap and DOES NOT open a new
document?

Larry
 
S

Suzanne S. Barnhill

If I use the hotkey when Word is not open, it does open with a blank
document. If a document is already open, it just brings that document window
to the front.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
L

Larry

Suzanne, is the shortcut for the hotkey you're talking about similar to
the one I'm experimenting with:

"C:\Program Files\Microsoft Office\Templates\Normal.dot"

Or is it a different shortcut? If it's different, please show me what
it is.

Larry
 
S

Suzanne S. Barnhill

No, my shortcut is for the executable: "C:\Program Files\Microsoft
Office\OFFICE11\WINWORD.EXE"

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
L

Larry

Ok, you said that if you run a shortcut to the executible with Word
already open, it doesn't open a new instance but brings Word to the
front. But when I do the same, with this,

"C:\Program Files\Microsoft Office\Office\WINWORD.EXE"

it opens a new instance of Word, which is what I don't want.

Are you perhaps using Word 2002 with SDI turned on? Just a possibility
that occurred to me. :)

Larry





then you're getting
 
S

Suzanne S. Barnhill

I'm actually using Word 2003 with SDI, but it worked the same in 2002.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
L

Larry

Just to return to my original point, which no one has been able to
explain:

In Windows 98, two different behaviors occur when a shortcut to the
normal template is clicked, and when a hotkey assigned to that shortcut
is pressed.

Larry
 
G

Gary S. Terhune

Yes, well...

If you're expecting an explanation, you'll need to ask in a programmer's group. Suffice it to say, using a Hotkey isn't the same as double-clicking a LNK file. That Hotkey execution is not precisely the same as LNK file execution doesn't surprise me, but neither I nor anyone else who frequents either of the groups you posted to is likely to have the answer at their fingertips. Just figuring out the behavior of launching apps using VB Script is mind-twisting enough, without getting into DDE, etc. Beyond that, you're talking about an Office app, and that has a whole 'nother level of strangeness involved.

Your launching of Normal.dot isn't even a straight launching of an app--it's another layer of file association. If you have any talent in the realm of Registry sleuthing, I'm betting this mystery would keep you busy for longer than you've been at this thread, <bg>.
 

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