Access and Outlook - 2 Questions

  • Thread starter Thread starter Rick Brandt
  • Start date Start date
R

Rick Brandt

Ian said:
We've created a database that has the ability to create pdf format
reports, and email them as attachments using Outlook.

I have Office XP on my machine, but when my colleague uses the prog
in 2003, I have to reset the reference to the Outlook object library
when I want to use it again.

Question 1 is, am I right in thinking that if I make the database an
MDE file in XP, this will overcome the problem?

No. It will just make it impossible to correct on the other machine.
Question 2; I feel I should know the answer to this, but if I did,
I've forgotten. How can I detect if the user has Outlook installed
on their machine, before they can access the emailing facility?

Switch to late binding. That will make the Outlook code version independent and
the user will get an error that you can trap for when they don't have Outlook
installed.

One shoud (almost) never add a reference to an Access app that is expected to
run on systems that are not exactly the same.
 
I have Office XP on my machine, but when my colleague uses the prog in
2003,
I have to reset the reference to the Outlook object library when I want to
use it again.

Question 1 is, am I right in thinking that if I make the database an MDE
file in XP, this will overcome the problem?

No, using a mde will not fix this problem. However, using a mde is a really
good idea, since any un-handled error will NOT reset all of your local and
global variables. Further, the mde can't be come un-compiled, and as a
result will often bloat a LOT less. And, the mde is smaller then the mde.
And, users can't see, nor make modifications to the code, or the forms. I
could write even more reasons..but, they are good thing to use.

Of course, if you going to adopt and use mde, then you really have to split
your database (else, you can't update the customers software in the field
without overwriting the data at the same time).

the solution to word, or outlook automation is to use late binding. If you
do that, likely your software will work with outlook 2000, 2002 and 2003
without even having to SET reference. so, use late binding..it will solve of
this problem....
Question 2; I feel I should know the answer to this, but if I did, I've
forgotten. How can I detect if the user has Outlook installed on their
machine, before they can access the emailing facility?

When you use late binding, you have to create an instance of outlook...if
that creating fails..then outlook is not avialbile...

eg:


on error resume next
Set ol = CreateObject("Outlook.application")
if err.number <> 0 then
msgbox "sorry, outlook is not intsalled",
exit sub
end if
on error goto 0

....you code contineus here.....

You can read up on late binding here:
http://www.granite.ab.ca/access/latebinding.htm

Usually what happens is that you develop and test and get everything working
using early binding..and then convert to late binding, and then remove the
refernce.
 
We've created a database that has the ability to create pdf format reports,
and email them as attachments using Outlook.

I have Office XP on my machine, but when my colleague uses the prog in 2003,
I have to reset the reference to the Outlook object library when I want to
use it again.

Question 1 is, am I right in thinking that if I make the database an MDE
file in XP, this will overcome the problem?

Question 2; I feel I should know the answer to this, but if I did, I've
forgotten. How can I detect if the user has Outlook installed on their
machine, before they can access the emailing facility?

Many thanks

Ian King
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top