Word XP macros in Word 2007

R

robot

Hello,

I am using Word XP, considering upgrading to Word 2007.

I am concerned about opening my XP documents using Word 2007, because I
remember that ages ago, Word 6 macros, once opened by Word 97, are
automatically converted to Word 97 (vba) macros, and can never again be
opened by Word 6.

What will happen to my Word XP macro if the document containing the macro is
opened in Word 2007? I hope to use my XP macros in both Word XP and Word
2007 if possible.

Suggestions are most welcome!
 
J

Jay Freedman

The conversion between Word 6 and Word 97 involved the change from WordBasic
to VBA. There's no such conversion between Word 2002 and Word 2007, as they
both use the same VBA.

There are some new objects and methods in Word 2007, of course, and if you
use them in macros you write in Word 2007 and try to run the macros in Word
2002 then you will get compilation errors. The easiest solution is not to
use any of the new objects. Fortunately, a new feature of the VBA help in
2007 is a notice at the top of a help topic if it describes something new.
If you can't or won't avoid new things, you'll have to segregate them into
modules that get loaded only if the current Word instance is 2007.

There are also some things in Word 2002 that will no longer work, or at
least work correctly, in Word 2007. The main things to look out for are
custom toolbars and menus (CommandBar objects and their descendants) and
AutoTextEntries, and some of the Options members.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
R

robot

Hi Jay,

Thank you very much for your help.

Jay Freedman said:
The conversion between Word 6 and Word 97 involved the change from
WordBasic to VBA. There's no such conversion between Word 2002 and Word
2007, as they both use the same VBA.

There are some new objects and methods in Word 2007, of course, and if you
use them in macros you write in Word 2007 and try to run the macros in
Word 2002 then you will get compilation errors. The easiest solution is
not to use any of the new objects. Fortunately, a new feature of the VBA
help in 2007 is a notice at the top of a help topic if it describes
something new. If you can't or won't avoid new things, you'll have to
segregate them into modules that get loaded only if the current Word
instance is 2007.

There are also some things in Word 2002 that will no longer work, or at
least work correctly, in Word 2007. The main things to look out for are
custom toolbars and menus (CommandBar objects and their descendants) and
AutoTextEntries, and some of the Options members.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.
 

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