Version specific/select code?? 
Author Message
 Version specific/select code??

Hi guy n gals,

Is there a way for me to check which version of word is being run when i
jstart up a VBA project?  the problem is that the app behaves in strange
ways depending on teh version used!  Also I don't know much about Signature
keys but the signed version will work with word 2k but not so well with word
97.

Any help appreciated!

john



Wed, 20 Jul 2005 00:10:56 GMT  
 Version specific/select code??
John

Application.Version is perhaps what you want.

Regards
  Malc
  www.dragondrop.com

p.s.  Yah!  Last question; off to the nuclear sub!



Wed, 20 Jul 2005 03:16:30 GMT  
 Version specific/select code??
Hi, John,

If you're running the same macros in Word 97 and Word 2000/2002, you
might have some calls to functions in the later versions that don't
exist in the earlier one (e.g., Split, Join, and Replace functions were
all new in Word 2000).

To avoid having to write separate macros, you can use "conditional
compilation". This is based on the fact that the value VBA6 is defined
in Word 2000/2002 but is not defined in Word 97. You can use the special
statements that start with the # character to put in code that is or is
not "seen" by the VBA compiler depending on whether the value is
defined -- something like this:

#If VBA6 Then
    MsgBox "Word 2000/2002"  ' invisible to Word 97
#Else
    MsgBox "Word 97"  ' invisible to Word 2000/2002
#End If

For example, the 2000/2002 code might use the Split function, while the
Word 97 code uses a longer and slower equivalent that doesn't throw a
compilation error.

Is that what you're looking for?

--
Regards,
Jay Freedman
Microsoft Word MVP        Word MVP FAQ site: http://www.mvps.org/word

Quote:

> Hi guy n gals,

> Is there a way for me to check which version of word is being run
> when i jstart up a VBA project?  the problem is that the app behaves
> in strange ways depending on teh version used!  Also I don't know
> much about Signature keys but the signed version will work with word
> 2k but not so well with word
> 97.

> Any help appreciated!

> john



Wed, 20 Jul 2005 05:15:56 GMT  
 Version specific/select code??
Yeah that gives me some ideas thx very much :)  I'm kinda new to VB and I've
never used VBA before so i might be a regular pest with questions on this
group :)

Regards

John


Quote:
> Hi, John,

> If you're running the same macros in Word 97 and Word 2000/2002, you
> might have some calls to functions in the later versions that don't
> exist in the earlier one (e.g., Split, Join, and Replace functions were
> all new in Word 2000).

> To avoid having to write separate macros, you can use "conditional
> compilation". This is based on the fact that the value VBA6 is defined
> in Word 2000/2002 but is not defined in Word 97. You can use the special
> statements that start with the # character to put in code that is or is
> not "seen" by the VBA compiler depending on whether the value is
> defined -- something like this:

> #If VBA6 Then
>     MsgBox "Word 2000/2002"  ' invisible to Word 97
> #Else
>     MsgBox "Word 97"  ' invisible to Word 2000/2002
> #End If

> For example, the 2000/2002 code might use the Split function, while the
> Word 97 code uses a longer and slower equivalent that doesn't throw a
> compilation error.

> Is that what you're looking for?

> --
> Regards,
> Jay Freedman
> Microsoft Word MVP        Word MVP FAQ site: http://www.mvps.org/word


> > Hi guy n gals,

> > Is there a way for me to check which version of word is being run
> > when i jstart up a VBA project?  the problem is that the app behaves
> > in strange ways depending on teh version used!  Also I don't know
> > much about Signature keys but the signed version will work with word
> > 2k but not so well with word
> > 97.

> > Any help appreciated!

> > john



Thu, 21 Jul 2005 22:34:44 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using Specific .dll Versions

2. Registering/Invoking of specific version of ActiveX control.

3. Setting a page to use a specific http version using script

4. Create Database - Version specific

5. reposted: language specific MDAC versions?

6. Selecting fields from a specific row in a continuous form

7. Event in VBA that starts only if I select a specific shape

8. Selecting specific position........word97

9. selecting specific position in document word 97

10. Selecting specific text/words

11. How to Select the content of a specific page

12. Selecting specific range of fields

 

 
Powered by phpBB® Forum Software