importing macros from Word 2003 for windows to Word 2004 for mac

G

GreenThump

I have recently migrated from PC to Mac. I've created a lot of macros in Word 2003 for Windows and assigned them to toolbars and menus. Is there any way I can import them into Word 2004 for Mac. I tried copying the Normal.dot file from Word 2003 into the folder where the Normal template file for Word 2004 for Mac resides, but it wouldn't overwrite it. Is it at all possible? Both the Windows and Mac versions use Visual Basic, so I figured the macros should work. Thanks.
 
C

CyberTaz

Hi GreenThump -

You first might like to review the following link - especially the bottom
article re VBA (as well as the link to George Clark's article - even if you
aren't a "developer"):

http://word.mvps.org/mac/Differences.html

Keeping that in mind, *do not* attempt to replace the Normal template on any
one system with one from another system - especially if customizations have
been done. Serious problems can ensue. Instead, in Word 2004 go to Tools>
Templates & Add-Ins, click the Organizer button & use it to copy the macros
& toolbars from the PC Normal.dot to the Mac Normal template (note the
_lack_ of the .dot extension on the Mac - that's a significant distinction).

Others may have some suggestions to offer as well:)

HTH |:>)
Bob Jones
[MVP] Office:Mac
 
J

John McGhie

Yes, the macros will work.

The secret is that ‹ due to a bug that has been fixed in the next version,
Word 2004 will not recognise a Normal template that has the extension ".dot"

Remove the ".dot" from the end of the file name, then use File>Open to open
the file named just "Normal", then add and remove a space, then SAVE and
close.

That writes the Mac file type and creator code into the template, and after
that, Word will be perfectly happy with it.

Bob's warning that you will get some entertainment is perfectly true. Word
2003's VBA is two levels ahead of Word 2004. You are bound to get a few
errors you need to resolve. So:

Open the template again, hop into the VBA Editor, and from the Debug menu
choose "Compile Normal".

Chances are you will get an error message and the offending statement will
be highlighted in yellow. Comment it out or code around it and try again.

Keep at it until the thing compiles without an error, then Save again.

What it does not complain about will probably work just fine :)

Then again, it may not :)

Look up the "Hash If" statement (#IF Mac then...) in the VBA help.

The compiler constant "Mac" becomes TRUE if the macro is running in Mac
Word. Use the hash-if to perform conditional compilation of any statements
that will not compile on one platform or the other. VBA is pre-compiled at
template opening: anything fenced off on a has-if will compile only on the
correct platform. There's an example in the help.

I use this technique to run the same template in both Mac and Windows Word.

Hope this helps


I have recently migrated from PC to Mac. I've created a lot of macros in Word
2003 for Windows and assigned them to toolbars and menus. Is there any way I
can import them into Word 2004 for Mac. I tried copying the Normal.dot file
from Word 2003 into the folder where the Normal template file for Word 2004
for Mac resides, but it wouldn't overwrite it. Is it at all possible? Both the
Windows and Mac versions use Visual Basic, so I figured the macros should
work. Thanks.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Nhulunbuy, Northern Territory, Australia
+61 4 1209 1410, mailto:[email protected]
 

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