Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2007

Tip: Looking for answers? Try searching our database.

macro to copy keystrokes?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alynn Baker - 29 Nov 2007 00:42 GMT
In early versions of Wordperfect, I was able to create macros that captured
keystrokes and replayed them. I wonder if there is a way to do that in Word
2000?

For example, I have several folders under "my documents." I would create a
macro that lets me open a particular folder so I can choose any file to open
from it. But if I record a macro, I have to go all the way to choosing a
file to open and then the macro always opens that file rather than stopping
the file-open dialog so I can choose any file in that folder. If I could
just record the keystrokes as far as doing file>open>choose the folder and
then wait there for my choice of documents, it would be helpful.

Is there a way to just record the keystrokes?

(Please note that someone, years ago, created just such a file-open macro
for me. So I do have a macro to do what I said above. But it's not something
like a macro that replays keystrokes that I could use for any series of
keystrokes. I just used that as an example.)

I hope this all makes sense!
Jay Freedman - 29 Nov 2007 02:28 GMT
It makes sense, but Word very much does _not_ work that way. Even when
the macro recorder works (which isn't often), it isn't geared to
recording keystrokes. As in your example, I could write a macro that
would do what you ask -- and you could write one, too, with a little
study -- but the recorder isn't the way to get there. If you want to
use it as a starting point, though, see
http://www.word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm.

Instead of trying to force Word to your wishes, step outside the Word
box and grab the free utility from www.autohotkey.com. I think you'll
be happier with something that was intended to play back keystrokes.

>In early versions of Wordperfect, I was able to create macros that captured
>keystrokes and replayed them. I wonder if there is a way to do that in Word
[quoted text clipped - 16 lines]
>
>I hope this all makes sense!

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
Alynn Baker - 03 Dec 2007 01:42 GMT
I found the mvps article interesting and deleted some of the extra verbiage
in my older Word macros. Thanks for that and for leading me to look at
autohotkeys.

I d/led autohotkey and will need more than the last hour I've spent trying
to understand anything.

Anyway, I'm most interested in doing one thing at this time  (instead of
just copying keystrokes which I did with the autohotkey program and didn't
like the results as you hinted! ).

My primary interest is to send a Word document, which is already saved on
screen, to a specific home-network folder while still in Word. (I already
created a batch file outside of Word that finds all files created today in
my data folders and xx-copies them to that network folder)

I created an autohotkey as follows:

#a::send !fa"\\8400desktop\disks\from laptop\  "

In Word 2000 it does execute the menu command alt file save-as to save in my
network folder called "\disks\from laptop." But it types out
\\8400desktop\disks\from laptop\  " where the file name belongs. I have to
type in a new filename before the closing quote mark. That's a start.

I would like it to use the filename already set instead of typing in the
name. Is there a command in authotkey to keep the filename?

If Word2000 would only use all the lines that show up in the sendto folder
in Explorer, I wouldn't have this problem. But it won't utilize the sendto
lines I have to send to specific folders.

Thanks again for the leads.

If you want to
> use it as a starting point, though, see
> http://www.word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm.
>
> Instead of trying to force Word to your wishes, step outside the Word
> box and grab the free utility from www.autohotkey.com. I think you'll
> be happier with something that was intended to play back keystrokes.
Jay Freedman - 03 Dec 2007 02:33 GMT
I'm still not quite clear on what you're doing -- for example, do you
always want to open from or save to the same folder, or does the
folder name change from day to day?

Anyway, that sort of thing can be done by writing (_not_ by recording)
a macro that opens the built-in dialog with the desired folder already
selected. Look at these articles, and come back here if you can't see
how to fit the pieces together to suit your work flow:

http://www.word.mvps.org/FAQs/MacrosVBA/ChangeSaveAsPath.htm
http://word.mvps.org/FAQs/MacrosVBA/SetDefFilename.htm
http://www.word.mvps.org/FAQs/MacrosVBA/WordDlgHelp.htm

>I found the mvps article interesting and deleted some of the extra verbiage
>in my older Word macros. Thanks for that and for leading me to look at
[quoted text clipped - 37 lines]
>> box and grab the free utility from www.autohotkey.com. I think you'll
>> be happier with something that was intended to play back keystrokes.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.