Macro works fine in Word 2003 but not in Word 2000

B

Brian

I am currently running a macro in Word 2003 which works fine. But when I try
to run it in Word 2000 on a different computer I am getting an error.

Error:
Compile error - Method or data member not found

On Line:
..BookFoldPrinting = False

I did not write this macro and I dont know too much how it works but is
there a way I can run the macro in Word 2000?
 
M

macropod

Hi Brian,

BookFoldPrinting did not exist in Word 2000. To run your macro, you could
simply delete that line. Since it's set to false, the macro should run fine
in both versions without it.

Cheers
 
J

Jay Freedman

The best solution is probably to delete that line, or at least to change it
into a comment by typing an apostrophe at the beginning of the line. There
are probably two more lines after that one that mention BookFoldRevPrinting
and BookFoldPrintingSheets, and you need to remove those too.

Here's the technical explanation: When you create a macro by recording some
actions in a document, and one of those actions involves a dialog, the
recorder includes the settings of all the items in the dialog -- including
those you didn't change. In this case, you've recorded the File > Page Setup
dialog, and the recorder has included the default values of the three
BookFold items. There's a discussion of this in
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm.

The problem is that the BookFold feature doesn't exist in Word 2000, so it
doesn't know what to do with those settings. The result is the compile
error.

When you remove the lines from the macro, it will operate the same way in
both versions, assuming that you haven't previously turned on the BookFold
feature in the Page Setup dialog.

Unfortunately, there's no way to tell Word 2000 to simply ignore things from
later versions that it doesn't know about. The unfortunate thing is that
there is a mechanism that could have been used for this if Microsoft had
provided compiler constants to distinguish releases. But there is only one
constant, VBA6, that distinguishes Word 97 from all later releases.

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

Brian

Deleting the lines seemed to fix the problem. Thanks for the quick and
detailed response!
 

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