Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

Packaging for multiple office versions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 21 Dec 2005 18:34 GMT
Hi

I need to package one of my access apps and send to clients. My app calls
outlook to send emails. The problem is that client pcs can each have a
different version of outlook (2000, xp, 2003 etc.). How can I package my app
that it will work with any version of outlook?

Thanks

Regards
Sean - 21 Dec 2005 18:40 GMT
If you package in 2000 then 2003 will be able to read it
Danny J. Lesandrini - 21 Dec 2005 18:45 GMT
What you want is Late Binding.

Rather than set a reference to Outlook (which is linked to a specific version),
you would do something like this ...

Dim objOutlook As Object
Set objOutlook = CreateObject("Outlook.Application")

The problem is that you don't get intellisense when you do this, so I usually
write my code with bound objects, using a specific reference, and then unbind
them before delivery ... or whenever I'm done working with the objects.

Signature

Danny J. Lesandrini
dlesandrini@hotmail.com
http://amazecreations.com/datafast

> Hi
>
> I need to package one of my access apps and send to clients. My app calls outlook to send emails. The problem is that
> client pcs can each have a different version of outlook (2000, xp, 2003 etc.). How can I package my app that it will
> work with any version of outlook?
John - 26 Dec 2005 22:25 GMT
I am using

Private WithEvents objOutlook As Outlook.Application

and if I change it to

Private WithEvents objOutlook As Object,

I get the error Compile Error, Expected: Identifier on the word Object. Any
way to fix this?

Thanks

Regards

> What you want is Late Binding.
>
[quoted text clipped - 17 lines]
>> different version of outlook (2000, xp, 2003 etc.). How can I package my
>> app that it will work with any version of outlook?
Douglas J. Steele - 26 Dec 2005 22:31 GMT
Unfortunately, I don't believe you can use Late Binding in conjunction with
WithEvents.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I am using
>
[quoted text clipped - 32 lines]
>>> have a different version of outlook (2000, xp, 2003 etc.). How can I
>>> package my app that it will work with any version of outlook?
TC - 27 Dec 2005 03:20 GMT
More's the &^%$#$!@ pity.

Some of the SMTP mail components have terrific functionality, but also
use WithEvents. Since my own rule is "no early binding", I can't use
any of those components.

TC
Rick Brandt - 21 Dec 2005 18:46 GMT
> Hi
>
> I need to package one of my access apps and send to clients. My app
> calls outlook to send emails. The problem is that client pcs can each
> have a different version of outlook (2000, xp, 2003 etc.). How can I
> package my app that it will work with any version of outlook?

Late binding. This allows you to make use of external libraries without
setitng a reference to them and (for the most part) makes the code version
independent.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Lyle Fairfield - 26 Dec 2005 23:53 GMT
I have no interest in changing or criticizing anyone's practice of
automating Outlook in order to send e-mails.

I used to do this myself. I wrote my first code to do so about eight
years ago. Not so surprisingly there was a discussion then about early
and late binding.

I note there are many posts to CDMA outlining problems with automating
Outlook. I had problems myself, notably when system administrators
enetered fake addresses into system address books in order to confuse
the Melissa virus. They were successfull and they were also successful
in disabling an address search in my application. As they didn't tell
anyone, let alone me, of their covert activity, I was at a loss to
explain why the application worked one day, but not the next. [My first
rule of Access is: It's IT ('s fault).]

For beginners or non-previous-email senders who lurk I would like to
point out that beginning with Windows 2000, Microsoft has provided us
with CDO. CDO is implemented through CDOSys.Dll. CDO sends mail
quietly, simply, quickly, without warning messages and without fuss. I
use CDO now, I don't use Outlook.
John - 27 Dec 2005 01:31 GMT
Hi Lyle

Many thanks for that. Is it possible to post some sample code?

Many Thanks

Regards

>I have no interest in changing or criticizing anyone's practice of
> automating Outlook in order to send e-mails.
[quoted text clipped - 17 lines]
> quietly, simply, quickly, without warning messages and without fuss. I
> use CDO now, I don't use Outlook.
Lyle Fairfield - 27 Dec 2005 01:42 GMT
http://groups.google.ca/group/comp.databases.ms-access/msg/7dd9ac8179e2ba41
John - 27 Dec 2005 12:37 GMT
Thanks

Regards

> http://groups.google.ca/group/comp.databases.ms-access/msg/7dd9ac8179e2ba41
Bri - 27 Dec 2005 19:20 GMT
> http://groups.google.ca/group/comp.databases.ms-access/msg/7dd9ac8179e2ba41

In AC97 (on WinXP PC) I get "Can't add a reference to the specified
file" when I try to add the reference to cdosys.dll (via Browse). If I
Look through my References, I find that there is one called Microsoft
CDO for Exchange 2000 Library (CDOEX.DLL). This seems to be the Exchange
(vs SMTP) version of CDO, I don't think this will help unless I was
runing Exchange. Since it doesn't show up in the listed references I
thought maybe that cdosys.dll needed to be registered, but regsvr32
gives an error message that it failed to register. Any ideas?

--
Bri

ps. Tried to set the reference in VB6 as well (via Browse) and it didn't
give me an error message, but it did NOT add the reference either.
Lyle Fairfield - 27 Dec 2005 21:10 GMT
>> http://groups.google.ca/group/comp.databases.ms-access/msg/7dd9ac8179e
>> 2ba41
[quoted text clipped - 15 lines]
> didn't give me an error message, but it did NOT add the reference
> either.

I"m sorry that I don not know what this problem is. I'm "pretty" sure I
have used CDO in Access 97 but I cannot check that now.

I suspect using late binding will not work but myabe it's worth a try.
Examples of late binding a la VB Script (to be used in ASP) can be found at
http://www.w3schools.com/asp/asp_send_email.asp
They should work in Access 97 VB without much change.

Signature

Lyle Fairfield

Bri - 27 Dec 2005 22:13 GMT
>>>http://groups.google.ca/group/comp.databases.ms-access/msg/7dd9ac8179e
>>>2ba41
[quoted text clipped - 23 lines]
> http://www.w3schools.com/asp/asp_send_email.asp
> They should work in Access 97 VB without much change.

Thank you for that example. I modified your example code to use the late
binding and it worked perfectly.

Dim iCfg As Object
Dim iMsg As Object
Set iCfg = CreateObject("CDO.Configuration")
Set iMsg = CreateObject("CDO.Message")
'the rest is the same as Lyle's original example

--
Bri
Lyle Fairfield - 27 Dec 2005 22:26 GMT
> Thank you for that example. I modified your example code to use the
> late binding and it worked perfectly.
[quoted text clipped - 7 lines]
> --
> Bri

Great! :-)

Signature

Lyle Fairfield

Ted - 29 Dec 2005 02:38 GMT
I can't get the CDO function to work with my Access 2003 database
application.
I'm getting a "The transport failed to connect to the server" error.
I don't understand what I'm missing. I'm using gmail as the smtp server
with my userid and password.
Can someone please help me with a good example?
Thanks!
Ted
TC - 29 Dec 2005 02:42 GMT
What URL have you used? (I bet it wasn't just "gmail".)

Normally you should do a DNS MX query on a domain name, to get the
address of the SMTP server for that domain.

HTH,
TC
Arno R - 29 Dec 2005 11:20 GMT
>I can't get the CDO function to work with my Access 2003 database
> application.
[quoted text clipped - 4 lines]
> Thanks!
> Ted

I guess there is no Internet connection at the time the code runs.
I remember getting the same error when using the cdo-code with a dial-up-connection.

Arno R

 
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.