Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One Macro, Two versions (Word97/Word2003)

    Hello,
    I would like to know if a word macro can be written to perform within the macro depending on the version of word on machine?(Word98 or Word2003). I need to create this for user who might have different version of Word.
    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: One Macro, Two versions (Word97/Word2003)

    Hi Sonny

    The answer is yes. Just remember you can't write 2003 VBA in a 98 but you can write 98 code in 2003...if that makes sense
    Jerry

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: One Macro, Two versions (Word97/Word2003)

    You can test Application.Version. This is a string with the following value:

    <table border=1><td>Word</td><td>Version</td><td>97</td><td align=right>8.0</td><td>2000</td><td align=right>9.0</td><td>2002 (XP)</td><td align=right>10.0</td><td>2003</td><td align=right>11.0</td></table>
    So you could use

    Select Case Application.Version
    Case "8.0"
    ...
    Case "11.0"
    ...
    End Select

    Warning: if you put Word 2003-specific code in the Case "11.0" part, Word 97 may balk at it even if it doesn't get called there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •