Re: Word version independent macros by Jezebel
Jezebel
Thu Aug 31 05:44:14 CDT 2006
Test your macros on the Word 97 machine. If they will run there, they will
run on all the later versions. ActiveDocument and Selection objects have
been around since W97; but obviously there are all the Word features that
have been added since, that you can't use if the code has to run on W97.
There are also some VBA functions that have been added since 97 (Split and
Join come to mind) not sure what else.
You can do version-specific work using constructions like --
Dim pWordApp as object
Set pWordApp = Application
if pWordApp.Version > 10 then
pWordApp.[method added after Word 10]
else
msgbox "Can't do that with this version of Word"
end if
But your application will quickly become unmanagable if you do much of this.
"sweet_dreams" <sweet_dreams@o2.pl> wrote in message
news:1157019420.981462.317670@m73g2000cwd.googlegroups.com...
> Hi,
>
> I have created word template with some subs and functions. Generally
> this macros, copy content of other .doc dokument and paste it to active
> document, create tables and format text. I created this template in
> wrod 2003. But it turned out that this template will be used on
> computers where are Word versions form 97 to 2003 and in the future
> perhaps 2007.
> So my question is what can I do to make this template (especialy macros
> in this template) Word version independent? Can I use objects like
> ActiveDocument, Selection??? Or Should I rewrite this macros using late
> binding???
>
> Any help, suggestions will be appreciated.
>
> Regards,
> sweet_dreams
>