Sunday, September 10, 2006

Version Compatibility

I have been engaged in a mild debate over at Woody's Lounge regarding the various versions of Word. My incoming task was to obtain the most recently used file list for each and every version of Word from Office 2007 through Office 2007.

MRUse in its initial incarnation made use of the application object, its Recent Files list. That approach does not work when several versions of the application exist.

Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application") ' gets me 9.0, but I want all!
Dim lng As Long
For lng = 1 To xlApp.RecentFiles.Count
Dim strFullName As String
strFullName = xlApp.RecentFiles(lng).Path


The code snippet above will always grab Excel 9.0's recent files if Excel 9.0 was the latest version (of 8.0, 9.0, 10.0, 11.0 and 12.0) to be loaded and used.

I need dive into the registry now, and that is what I do.

Dim lng As Long
For lng = lngLow To lngHigh
Dim strValue As String
strValue = strWeTrim(QueryValue(HKEY_CURRENT_USER, _
strKey, strValuePrefix & Trim(Str(lng))))


The debate does not quite rage, but if it did, it would rage over the issue of whether or not one can successfully run four versions of Office under a single operating system (Windows XP) on a single partition single-boot system.

Yes you can! I am doing just that.

I have a 2GB RAM 100GB drive laptop with Windows XP professional, and licensed copies of Office 97, Office 2000, Office 2003 and Office 2007 beta, installed in that sequence.

I can load a copy of each version of Word and thus have four versions of Word running on the machine.

Each version of Word uses the same default file locations for documents, Startup folder and so on, so each version of word exhibits and permits use of the applications (Under, Trail, Indxr and so on) that I have developed in Word VBA for end-users of Word.

The only annoyances I have spotted so far are:

From time to time Office 2000 or Office 2003 whips out its flashlight and looks for something. I think it thinks it is "repairing" the registry because a different version of Office has just "repaired" it back to its own devices.

From time to time my Toolbars Best Fit macro doesn't. I will look into this. I suspect it will be found as a programming error on my part.


Apart from that, I can't see any major conflict that faces me, as a developer of VBA applications in multiple versions of Office.

0 Comments:

Post a Comment

<< Home