Problem with versions of word and outlook

J

John

Hi

My access app uses word and outlook references which I can not get rid of
due to certain features that my app has. I have this problem that I need to
send me app to various clients who have varying versions of outlook and word
and thus my app fails to run. Is there anyway my app can find the versions
of outlook/word at start-up and readjust links to appropriate versions of
outlook/word before continuing? If not, is there another way to fix this
problem?

Many thanks. Any help would be appreciated. I am really stuck.

Regards
 
D

Douglas J. Steele

Whoa: no need to include so many newsgroups!

Consider using Late Binding, so that you don't need to set any references.
When you go to instantiate the object, you'll get an Error 429 if the user
doesn't have any version of the product.

Tony Toews has an introduction to the topic at
http://www.granite.ab.ca/access/latebinding.htm
 
J

John

Thanks but can't use lat binding as I am using WithEvents to receive back
outlook and word events.

Regards
 
J

John

Thanks. How do you 'Use a generic reference'? I use the reference by ticking
in the appropriate ones in the list of references under Tools->References in
code windows. There are only specific versioned references only such as
Outlook 8 or 9 etc. Sorry for being naive.

Thanks again

Regards
 
J

James A. Fortune

John said:
Hi

My access app uses word and outlook references which I can not get rid of
due to certain features that my app has. I have this problem that I need to
send me app to various clients who have varying versions of outlook and word
and thus my app fails to run. Is there anyway my app can find the versions
of outlook/word at start-up and readjust links to appropriate versions of
outlook/word before continuing? If not, is there another way to fix this
problem?

Many thanks. Any help would be appreciated. I am really stuck.

Regards

I work in a company that uses multiple versions of Office software. I
develop in A97 and convert the database (usually to A2K format). Use a
generic reference such as "Outlook.Application" without any version
information whether using early binding (e.g.,
CreateObject("Word.Application")) or late binding (e.g., Dim objWord As
New Word.Application). Access will open the appropriate version of the
Office program requested if it exists.

James A. Fortune
[email protected]

If we can't identify your admin code, we will by default run it as
Standard User. So it's time to mark that admin code. Going forward,
the correct way to mark admin code is to build an application manifest,
which is just a little piece of XML that says the requested run level of
this application is admin. And you attach that to the exe and then you
sign it. Now that's not going to harm that exe when you run it on XP,
it will be ignored. -- Steve Hiskey, PDC05 FUN406
 
J

John

I can't be at al client sites. Often I need to email the MED to them and it
fails on the other side if their versions of Outlook/Word are different than
mine.

I wonder if there is a way to programmatically;

1. Find the version of Outlook/Word on current PC and

2. Set the reference to the relevant Outlook/Word version (just like we do
using Tools->Reference menu).

Thanks

Regards
 
J

James A. Fortune

John said:
Thanks. How do you 'Use a generic reference'? I use the reference by ticking
in the appropriate ones in the list of references under Tools->References in
code windows. There are only specific versioned references only such as
Outlook 8 or 9 etc. Sorry for being naive.

I see I misunderstood the question. How about: In A97, I simply set the
reference to the existing one for Word or Outlook. When I convert the
database on the user's machine, Access picks up the correct references.
Thus, you can come up with a version that works in Office XP, another
that works in Office 2003, etc. Is that an option?

James A. Fortune
[email protected]

Shoot the duck. Blaam! Let's try this again, shall we? -- Daffy Duck
 
R

Robert Morley

You *might* be able to do that by first going through an outside program.
For example, create a program in VB, or even another Access database that
opens your main database and sets the references appropriately, using the
References Collection. I know I played with it some time back, but I don't
remember whether I was able to get it to work properly or not. It's
definitely non-trivial, but if no other solution presents itself, it may
work.



Rob
 
P

Paul Shapiro

I think that's possible. I remember doing that during the transition to
Office 97. You can run some startup code that checks for missing references.
If you find missing ones, run through your list of possible references until
you find a match. You have to get the code working in an environment where
the references are missing, so you can test what runs successfully.

You might also have some luck by using the oldest possible references. I
think each version of Office can check to replace older references with
newer ones.

For both cases, setting up some virtual PC's can give you a valuable
test/development environment.

I have some sample code which was working when I last had to deal with this
issue. I'm sending that in a zip file to your email address since it's too
large to include here.
 
J

James A. Fortune

John said:
I can't be at al client sites. Often I need to email the MED to them and it
fails on the other side if their versions of Outlook/Word are different than
mine.

I wonder if there is a way to programmatically;

1. Find the version of Outlook/Word on current PC and

2. Set the reference to the relevant Outlook/Word version (just like we do
using Tools->Reference menu).

Thanks

Regards

Those are interesting questions.

To get the version of Office or Word/Outlook, you could test for the
existence of the following folders in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Word
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Outlook
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Word
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Outlook
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Word
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Outlook
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Word
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Outlook

There's some registry code here:

http://groups.google.com/group/comp.databases.ms-access/msg/c149fec6f6d5b594

BTW, for .pdf files, the code posted in the cited URL did not work on
all machines in the company so I hybridized the function to use that key
when available and to revert back to my old technique when the key is
not available.

I got my descriptions for early and late binding mixed up earlier. I
should have examined which one requires Dim ... As Object for late
binding. Rough day. I'm not sure how you would set the reference in
code once you have the Office version. Maybe Googling will produce that.

James A. Fortune
[email protected]
 
D

DAVID

You can't change a reference in an MDE.

You can't use an 8 reference with a 9/10/11
version: that is like using an Excel reference
instead of a Word reference. MS made a mistake
with 9, it and all following references are
not compatible with 8.

If you need 8,9 and an MDE, use VB6 to create
an object that exposes all of the Word and
Outlook methods and properties you use, and
connects them on initialisation to real Word
and Outlook objects...

(david)
 
A

Alex Dybenko

Hi,
I think best approach for you - is to make MDE version for each combination
of outlook/access and then install appropriate version at client
you can also try to use reference to lowest version of outlook/work, if some
case it will work with later versions, but to be sure - use separate
versions

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
B

BeWyched

To retrieve the local Word version use:

Dim wdApp, WordVersion

Set wdApp = New Word.Application
WordVersion = wdApp.Version

Cheers.

BW
 
Top