Macro tool

  • Thread starter Joseph Chamberlain, DDS
  • Start date
J

Joseph Chamberlain, DDS

Dear all:

There are a few tasks I usually perform repetitively in Word to the point
that it got me thinking about transforming them into Macros. I looked at the
help in Word and was guided to the Macro option under the tools menu but I
can't find a Macro there.

Where is the Macro command for recording new Macros located under Word 2004
? Is there another source of reference on how to develop good Macros for
automation other than the user help in Word ? I've found it to be a little
superficial. Also, can selections made with a mouse (buttons being clicked,
for instance) be recorded with Macros or only keyboard strokes ?

Thank you in advance for your help.

Best regards,

Joseph
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Joseph:

Look in Tools>Macro>Record new macro.

If it's not there, use Tools>Customise to RESET your menu.

Is there another source for developing macros: sure, but nothing comes close
to the Word Help. The trick is that it's context-sensitive: You must have
the Visual Basic Editor RUNNING and be clicked inside it before you can
display the Visual Basic Help file.

Any book on Word 2000 VBA will serve you well in Mac Word. This one is
excellent (and free!!):
http://msdn.microsoft.com/library/default.asp?URL=/library/officedev/odeopg/
deovroffice2000visualbasicprogrammersguide.htm

Don't purchase anything later: It will include references to VBA language
that does not exist on the Mac. Actually, I would go further: if you are
going to learn to automate Microsoft Office on the Mac, learn to do it in
AppleScript, not VBA. Microsoft has been trying to kill VBA off for years,
because it is not possible to secure it properly -- due to the fact that its
architecture was defined back in the days when the world and the Internet
was a nicer place in which more folks could be trusted :) It *will* go
away, and my guess is "sooner rather than later". If Microsoft had its
druthers, VBA would have been removed from all of its products by now.

That said, I start almost EVERY macro using the Macro Recorder: it will save
you literally hours, particularly on the Mac, where the Visual Basic editor
is a sad and stunted vestige of the PC version. {Sob} There is no
"recorder" for AppleScript... I use Word 2003 for almost all of my macro
development, either running in Virtual PC on the Mac, or accessing it via
Remote Desktop Connection from the PC.

To answer your final question: "Sort of". VBA is an "object oriented"
language, as is AppleScript. Keystrokes and selections are not of much
interest to it, since their meaning has value only in the exact context in
which they occurred. What VBA will "record" is the properties your
keystrokes and mouse actions applied to the object you had selected. In
some cases, you cannot record a "generic" macro, you record the "specific"
one, then edit it to make it useable in all circumstances. For example, VBA
will record the exact file name of the document you opened: you need to
change it to display the FileOpen dialog. VBA will record the exact string
to typed, you need to change it to make it ask for a string at run-time.

I recommend that you record a few, and when you get stuck, post your code in
here and we'll help you customise it.

Cheers

Dear all:

There are a few tasks I usually perform repetitively in Word to the point
that it got me thinking about transforming them into Macros. I looked at the
help in Word and was guided to the Macro option under the tools menu but I
can't find a Macro there.

Where is the Macro command for recording new Macros located under Word 2004
? Is there another source of reference on how to develop good Macros for
automation other than the user help in Word ? I've found it to be a little
superficial. Also, can selections made with a mouse (buttons being clicked,
for instance) be recorded with Macros or only keyboard strokes ?

Thank you in advance for your help.

Best regards,

Joseph

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 

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