Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

Word version independent macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sweet_dreams - 31 Aug 2006 11:17 GMT
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
Jezebel - 31 Aug 2006 11:44 GMT
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.

> Hi,
>
[quoted text clipped - 13 lines]
> Regards,
> sweet_dreams
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.