Is Outlook installed?

  • Thread starter Thread starter Basil
  • Start date Start date
B

Basil

Hiya,

I have a report that gets emailed to loads of people by
clicking a control on a form. I only want the report to
be emailed by users using MS Outlook. Some users have
Novell Groupwise - nobody has both installed on their PC.

Is there a way that I can see if MS Outlook is installed
(Using VBA - boolean variable or something)? I want to
run a script that only enables the control if Outlook has
been installed.

Any advice would really be appreciated.

Basil
 
You would need to determine some registry key that all versions of Outlook
will add to the registry. Then, use win32 API calls (from VBA) to check for
that key. This does not nevcessarily prove that Outlook is the >only< email
program on the PC. It only proves that Outlook is currently on the PC - or
that it >used to be<, and was deleted manually instead of being
de-installed.

To get started, look for VBA code that reads from the registry. There is
doubtless something at www.mvps.org (or whatever it is).

The VBA GetSettings() function (which reads from the registry) will not work
for this.

HTH,
TC
 
Instantiate Outlook and see if there is an error, i.e.,

Function HasOutlook() As Boolean

On error resume next

Dim olObj as Object

Set olObj = CreateObject("Outlook.Application")

HasOutlook = (err.Number=0)

End Function
 
Paul's method is much simpler. Mine does not require Outlook to start. On
balance, I'd suggest using Paul's.

HTH,
TC
 
Back
Top