Word 200 and Word 2002: VBA6 compiler constant does not do the job 
Author Message
 Word 200 and Word 2002: VBA6 compiler constant does not do the job

Has anybody found a means to distinguish between Word 2002 and Word 2000 VBA
with a compiler constant.
I find it difficult to believe that MSFT let this one slip by.

I cannot compile code in  Word 2000 that has any Word 2002 code not
recognized by Word 2000.
In some cases, I am able to write the code so I do not need the Word 2002
feature.
However, I cannot do that for features without adequate documentation.
In any case, a proper built-in compiler constant would eliminate the need
for such recoding.

This situation arose because code written in Word 2000, does not work
correctly in Word 2002, unless I add a modification of the
PasteSmartCutPaste property. But if I add that property, then the code will
not even compile in Word 2000.

Given the ambiguous "documentation" (see separate thread in this newsgroup),
I cannot guarantee that I can change the code to eliminate the need for
PasteSmartCutPaste in Word 2002.

--
Please post your response to the newsgroup. Do not email me a copy of the
message.

http://www.*-*-*.com/ ; Programming and support for  Word macros,
including converting from WordBasic to VBA; Technical reviewing; Standards;
Product functional/design/specifications
------------------------------------------------



Sun, 24 Oct 2004 04:21:51 GMT  
 Word 200 and Word 2002: VBA6 compiler constant does not do the job
Hi Howard,

There isn't a compiler constant for this.

The best available workaround is to put any Word 2002-specific code into a
separate module, and call it from the common modules. That way, the Word
2002-specific modules are never compiled when run under Word 2K.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Has anybody found a means to distinguish between Word 2002 and Word 2000
VBA
> with a compiler constant.
> I find it difficult to believe that MSFT let this one slip by.

> I cannot compile code in  Word 2000 that has any Word 2002 code not
> recognized by Word 2000.
> In some cases, I am able to write the code so I do not need the Word 2002
> feature.
> However, I cannot do that for features without adequate documentation.
> In any case, a proper built-in compiler constant would eliminate the need
> for such recoding.

> This situation arose because code written in Word 2000, does not work
> correctly in Word 2002, unless I add a modification of the
> PasteSmartCutPaste property. But if I add that property, then the code
will
> not even compile in Word 2000.

> Given the ambiguous "documentation" (see separate thread in this
newsgroup),
> I cannot guarantee that I can change the code to eliminate the need for
> PasteSmartCutPaste in Word 2002.

> --
> Please post your response to the newsgroup. Do not email me a copy of the
> message.

> http://www.standards.com/; Programming and support for  Word macros,
> including converting from WordBasic to VBA; Technical reviewing;
Standards;
> Product functional/design/specifications
> ------------------------------------------------



Sun, 24 Oct 2004 04:41:28 GMT  
 Word 200 and Word 2002: VBA6 compiler constant does not do the job
It has to be in a separate Project, not just a separate module.

--
Please post your response to the newsgroup. Do not email me a copy of the
message.

http://www.standards.com/; Programming and support for  Word macros,
including converting from WordBasic to VBA; Technical reviewing; Standards;
Product functional/design/specifications
------------------------------------------------

Quote:
> Hi Howard,

> There isn't a compiler constant for this.

> The best available workaround is to put any Word 2002-specific code into a
> separate module, and call it from the common modules. That way, the Word
> 2002-specific modules are never compiled when run under Word 2K.

> --
> Regards
> Jonathan West - Word MVP
> MultiLinker - Automated generation of hyperlinks in Word
> Conversion to PDF & HTML
> http://www.multilinker.com
> Word FAQs at http://www.multilinker.com/wordfaq
> Please post any follow-up in the newsgroup. I do not reply to Word
questions
> by email



> > Has anybody found a means to distinguish between Word 2002 and Word 2000
> VBA
> > with a compiler constant.
> > I find it difficult to believe that MSFT let this one slip by.

> > I cannot compile code in  Word 2000 that has any Word 2002 code not
> > recognized by Word 2000.
> > In some cases, I am able to write the code so I do not need the Word
2002
> > feature.
> > However, I cannot do that for features without adequate documentation.
> > In any case, a proper built-in compiler constant would eliminate the
need
> > for such recoding.

> > This situation arose because code written in Word 2000, does not work
> > correctly in Word 2002, unless I add a modification of the
> > PasteSmartCutPaste property. But if I add that property, then the code
> will
> > not even compile in Word 2000.

> > Given the ambiguous "documentation" (see separate thread in this
> newsgroup),
> > I cannot guarantee that I can change the code to eliminate the need for
> > PasteSmartCutPaste in Word 2002.

> > --
> > Please post your response to the newsgroup. Do not email me a copy of
the
> > message.

> > http://www.standards.com/; Programming and support for  Word macros,
> > including converting from WordBasic to VBA; Technical reviewing;
> Standards;
> > Product functional/design/specifications
> > ------------------------------------------------



Sun, 24 Oct 2004 06:41:34 GMT  
 Word 200 and Word 2002: VBA6 compiler constant does not do the job
Jonathan's quite right - see the add-in attached to
http://www.mvps.org/word/FAQs/Customization/ShowTaskPane.htm
for instance. It doesn't cause any compile errors when loaded by Word 97 or
2000.

(It does if you select Debug + Compile in 2000, but as long as you only ever
compile it in 2002, it works fine in 97/2000).

Regards

Dave


| It has to be in a separate Project, not just a separate module.
|
|
| --
| Please post your response to the newsgroup. Do not email me a copy of the
| message.
|
| http://www.standards.com/; Programming and support for  Word macros,
| including converting from WordBasic to VBA; Technical reviewing;
Standards;
| Product functional/design/specifications
| ------------------------------------------------


| > Hi Howard,
| >
| > There isn't a compiler constant for this.
| >
| > The best available workaround is to put any Word 2002-specific code into
a
| > separate module, and call it from the common modules. That way, the Word
| > 2002-specific modules are never compiled when run under Word 2K.
| >
| > --
| > Regards
| > Jonathan West - Word MVP
| > MultiLinker - Automated generation of hyperlinks in Word
| > Conversion to PDF & HTML
| > http://www.multilinker.com
| > Word FAQs at http://www.multilinker.com/wordfaq
| > Please post any follow-up in the newsgroup. I do not reply to Word
| questions
| > by email
| >


| > > Has anybody found a means to distinguish between Word 2002 and Word
2000
| > VBA
| > > with a compiler constant.
| > > I find it difficult to believe that MSFT let this one slip by.
| > >
| > > I cannot compile code in  Word 2000 that has any Word 2002 code not
| > > recognized by Word 2000.
| > > In some cases, I am able to write the code so I do not need the Word
| 2002
| > > feature.
| > > However, I cannot do that for features without adequate documentation.
| > > In any case, a proper built-in compiler constant would eliminate the
| need
| > > for such recoding.
| > >
| > > This situation arose because code written in Word 2000, does not work
| > > correctly in Word 2002, unless I add a modification of the
| > > PasteSmartCutPaste property. But if I add that property, then the code
| > will
| > > not even compile in Word 2000.
| > >
| > > Given the ambiguous "documentation" (see separate thread in this
| > newsgroup),
| > > I cannot guarantee that I can change the code to eliminate the need
for
| > > PasteSmartCutPaste in Word 2002.
| > >
| > > --
| > > Please post your response to the newsgroup. Do not email me a copy of
| the
| > > message.
| > >
| > > http://www.standards.com/; Programming and support for  Word macros,
| > > including converting from WordBasic to VBA; Technical reviewing;
| > Standards;
| > > Product functional/design/specifications
| > > ------------------------------------------------
| > >
| > >
| >
|
|



Sun, 24 Oct 2004 07:15:39 GMT  
 Word 200 and Word 2002: VBA6 compiler constant does not do the job
I've run into the same, and similar problems many times, and I agree
with the ridiculousness of the situation. The only workaround I've
found is to place the Word 2002-specific code in a separate function;
the compiler only seems to 'compile' subs and functions that are
actually called.

For Example
Sub AllVersions()
  Options.SmartCutPaste = False
  If Val(Application.Version) >= 10 Then
    DoWord10Stuff
  End If
End Sub

Sub DoWord10Stuff()
  Options.PasteSmartCutPaste = False
End Sub

This kind of code runs on Word 97/2000 and 2002 without compile
errors. It's a little ugly, but it works...

Peter Cooper

Quote:

> Has anybody found a means to distinguish between Word 2002 and Word 2000 VBA
> with a compiler constant.
> I find it difficult to believe that MSFT let this one slip by.

> I cannot compile code in  Word 2000 that has any Word 2002 code not
> recognized by Word 2000.
> In some cases, I am able to write the code so I do not need the Word 2002
> feature.
> However, I cannot do that for features without adequate documentation.
> In any case, a proper built-in compiler constant would eliminate the need
> for such recoding.

> This situation arose because code written in Word 2000, does not work
> correctly in Word 2002, unless I add a modification of the
> PasteSmartCutPaste property. But if I add that property, then the code will
> not even compile in Word 2000.

> Given the ambiguous "documentation" (see separate thread in this newsgroup),
> I cannot guarantee that I can change the code to eliminate the need for
> PasteSmartCutPaste in Word 2002.



Mon, 08 Nov 2004 11:58:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Word 2002: How to save a file in Word 97 format in Word 2002

2. Passing Userforms to subs (Word 2000 and 2002, I did not try Word 97)

3. Vba6 compiler constant

4. TimerKillEvent not doing its job??

5. SQL statement not doing its job

6. Question for Microsoft about Word 2000 and Word 2002

7. Word 2002 Template won't open in Word 2000

8. Differences on word 2002 and word 2000 vba

9. Going from Word 97 to Word 2002 (Macros)

10. VBA in a workgroup template runs slower on Word 2002 than on Word 97

11. Does Word VBA 2002 developed code run on Word 2000

12. Problem between version Word 2000 and Word 2002

 

 
Powered by phpBB® Forum Software