473,785 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Versions of Outlook

Hi all,

I have a database being used by 30 people and is split between the
backend and frontend. The database has the ability to send e-mails
through Outlook and I have even put Redemption on people's PCs as to
not get all the Outlook security prompts. Here's the problem: Half
are using Outlook 2003, the other half is using Outlook 2007, and 1 is
using Outlook XP. I am using Outlook 2007, so my reference is set to
use Microsoft Outlook 12.0, but other people need Outlook 11.0

Can I programmaticall y have the database detect what type of Outlook
is on the PC and set the reference accordingly?

Thanks in advance,
Laura
Nov 19 '08 #1
4 5158
On Nov 19, 5:09*pm, musicloverlch <lho...@gmail.c omwrote:
Hi all,

I have a database being used by 30 people and is split between the
backend and frontend. *The database has the ability to send e-mails
through Outlook and I have even put Redemption on people's PCs as to
not get all the Outlook security prompts. *Here's the problem: Half
are using Outlook 2003, the other half is using Outlook 2007, and 1 is
using Outlook XP. *I am using Outlook 2007, so my reference is set to
use Microsoft Outlook 12.0, but other people need Outlook 11.0

Can I programmaticall y have the database detect what type of Outlook
is on the PC and set the reference accordingly?

Thanks in advance,
Laura
Hi Laura,

I know about the issue using different versions of Outlook and usually
client agree to use only one version. However, here are couple of
ideas which I didn't try yet, but I think it might work.

Reference can be set programmaticall y with:

Application.Ref erences.AddFrom File FileName

Where FileName is Outlook DLL.

A better option might be not to use the reference if possible.
Actually I have found advice some time ago, but I don't know the
author nor it will work with Outlook. Following solution is for MS
Word reference:

-----
You can declare your word object as a generic object and then use the
CreateObject method.

So this

Dim WordApp as Word.Applicatio n
Set WordApp = New Word.Applicatio n

Would become

Dim WordApp as Object
Set WordApp = CreateObject("W ord.Application ")
----

This works with Word, as told, but you can give a try with Outlook.

If you have issues, let me know and I will give a try to make it work.

Regards,
Branislav Mihaljev
Microsoft Access MVP
Nov 20 '08 #2
On Nov 20, 12:42*pm, ban...@gmail.co m wrote:
On Nov 19, 5:09*pm, musicloverlch <lho...@gmail.c omwrote:
Hi all,
I have a database being used by 30 people and is split between the
backend and frontend. *The database has the ability to send e-mails
through Outlook and I have even put Redemption on people's PCs as to
not get all the Outlook security prompts. *Here's the problem: Half
are using Outlook 2003, the other half is using Outlook 2007, and 1 is
using Outlook XP. *I am using Outlook 2007, so my reference is set to
use Microsoft Outlook 12.0, but other people need Outlook 11.0
Can I programmaticall y have the database detect what type of Outlook
is on the PC and set the reference accordingly?
Thanks in advance,
Laura

Hi Laura,

I know about the issue using different versions of Outlook and usually
client agree to use only one version. However, here are couple of
ideas which I didn't try yet, but I think it might work.

Reference can be set programmaticall y with:

Application.Ref erences.AddFrom File FileName

Where FileName is Outlook DLL.

A better option might be not to use the reference if possible.
Actually I have found advice some time ago, but I don't know the
author nor it will work with Outlook. Following solution is for MS
Word reference:

-----
You can declare your word object as a generic object and then use the
CreateObject method.

So this

Dim WordApp as Word.Applicatio n
Set WordApp = New Word.Applicatio n

Would become

Dim WordApp as Object
Set WordApp = CreateObject("W ord.Application ")
----

This works with Word, as told, but you can give a try with Outlook.

If you have issues, let me know and I will give a try to make it work.

Regards,
Branislav Mihaljev
Microsoft Access MVP
Oh, I forgot. To remove reference programmaticall y use:

Application.Ref erences.Remove FileName

I assume you can test to see if DLL file exists with:

If Len(Dir(FileNam e)) 0 and then use Remove/AddFromFile commands.

Regards,
Branislav Mihaljev
Microsoft Access MVP
Nov 20 '08 #3

"musiclover lch" <lh****@gmail.c omwrote in message
news:c2******** *************** ***********@f40 g2000pri.google groups.com...
Hi all,

I have a database being used by 30 people and is split between the
backend and frontend. The database has the ability to send e-mails
through Outlook and I have even put Redemption on people's PCs as to
not get all the Outlook security prompts. Here's the problem: Half
are using Outlook 2003, the other half is using Outlook 2007, and 1 is
using Outlook XP. I am using Outlook 2007, so my reference is set to
use Microsoft Outlook 12.0, but other people need Outlook 11.0

Can I programmaticall y have the database detect what type of Outlook
is on the PC and set the reference accordingly?

Thanks in advance,
Laura
Look at the difference between Early and Late Binding. You are using early
binding which requires a reference to Outlook. the following function uses
late binding to create and preview or send a email using Outlook. Preview
does NOT cause the security warning. With late binding, you will need to
declare any constants you wish to use.

'---------------------
' Create a email with attachments
' stSendTo Email address
' stBody Body of the message
' stSubject Subject of the message
' astAttach Array of strings listing the path to the attachments
' intAcount Number of attachments
' intSend True if the message should be sent without preview

Public Function EmailAttach(ByR ef stSendTo As String, ByRef stBody As
String, ByRef stSubject As String, _
astAttach() As String, intAcount As
Integer, intSend As Integer) As Integer

On Error GoTo errEmailAttach

Dim oLook As Object
Dim oMail As Object
Dim i As Integer

Set oLook = CreateObject("O utlook.Applicat ion")
Set oMail = oLook.CreateIte m(0)
With oMail
.To = stSendTo
.Body = stBody
.Subject = stSubject
.ReadReceiptReq uested = True

If intAcount <0 Then
For i = 1 To intAcount
.Attachments.Ad d (astAttach(i - 1))
Next
End If

If intSend = True Then
.Send
Else
.Display
End If

End With

Set oMail = Nothing
Set oLook = Nothing
EmailAttach = True
Exit Function

errEmailAttach:

MsgBox "The following error was noted : " & Err.Description & Chr$(10) &
Chr$(13) & _
"Your email may not have been sent.", vbCritical, "Error"

On Error Resume Next
Set oMail = Nothing
Set oLook = Nothing
EmailAttach = False

End Function
Nov 20 '08 #4
Thanks for all your advice. I actually found something really cool on
experts-exchange after I read all the (very boring) stuff about early
vs late binding. This works great!:
Dim theRef As Variant, i As Long
Dim ref As Reference, strPath98 As String, strPath00 As String
Dim strPathXP As String, strPath03 As String, strPath07 As String
Dim fs
Set fs = CreateObject("S cripting.FileSy stemObject")

'Update the GUID you need below.
strPath98 = "C:\Program Files\Microsoft Office\Office
\msoutl85.olb"
strPath00 = "C:\Program Files\Microsoft Office\Office\m soutl9.olb"
strPathXP = "C:\Program Files\Microsoft Office
\Office10\msout l.olb"
strPath03 = "C:\Program Files\Microsoft Office
\OFFICE11\msout l.olb"
strPath07 = "C:\Program Files\Microsoft Office
\OFFICE12\msout l.olb"

'Set to continue in case of error
On Error Resume Next

'Remove any missing references
For i = 1 To Application.Ref erences.Count
Set theRef = Application.Ref erences.Item(i)
If theRef.IsBroken = True Then
Application.Ref erences.Remove (theRef)
End If
Next i

'Clear any errors so that error trapping for GUID additions can
be evaluated
Err.Clear

'Add the reference
If fs.FileExists(s trPath07) Then
Application.Ref erences.AddFrom File strPath07
ElseIf fs.FileExists(s trPath98) Then
Application.Ref erences.AddFrom File strPath98
ElseIf fs.FileExists(s trPath03) Then
Application.Ref erences.AddFrom File strPath03
ElseIf fs.FileExists(s trPath00) Then
Application.Ref erences.AddFrom File strPath00
ElseIf fs.FileExists(s trPathXP) Then
Application.Ref erences.AddFrom File strPathXP
End If

'If an error was encountered, inform the user
Select Case Err.Number
Case Is = 32813
'Reference already in use. No action necessary
Case Is = vbNullString
'Reference added without issue
Case Else
'An unknown error was encountered, so alert the user
MsgBox "A problem was encountered trying to" & vbNewLine _
& "add or remove a reference in this file" & vbNewLine &
"Please check the " _
& "references in your VBA project!", vbCritical + vbOKOnly,
"Error!"
End Select
On Error GoTo 0
End Sub

On Nov 20, 7:10*am, "paii, Ron" <n...@no.comwro te:
"musiclover lch" <lho...@gmail.c omwrote in message

news:c2******** *************** ***********@f40 g2000pri.google groups.com...
Hi all,
I have a database being used by 30 people and is split between the
backend and frontend. *The database has the ability to send e-mails
through Outlook and I have even put Redemption on people's PCs as to
not get all the Outlook security prompts. *Here's the problem: Half
are using Outlook 2003, the other half is using Outlook 2007, and 1 is
using Outlook XP. *I am using Outlook 2007, so my reference is set to
use Microsoft Outlook 12.0, but other people need Outlook 11.0
Can I programmaticall y have the database detect what type of Outlook
is on the PC and set the reference accordingly?
Thanks in advance,
Laura

Look at the difference between Early and Late Binding. You are using early
binding which requires a reference to Outlook. the following function uses
late binding to create and preview or send a email using Outlook. Preview
does NOT cause the security warning. With late binding, you will need to
declare any constants you wish to use.

'---------------------
' Create a email with attachments
' * stSendTo * * * Email address
' * stBody * * * * Body of the message
' * stSubject * * *Subject of the message
' * astAttach * * *Array of strings listing the path to the attachments
' * intAcount * * *Number of attachments
' * intSend * * * *True if the message should be sent without preview

Public Function EmailAttach(ByR ef stSendTo As String, ByRef stBody As
String, ByRef stSubject As String, _
* * * * * * * * * * * * * * * * *astAttach() As String, intAcount As
Integer, intSend As Integer) As Integer

* * On Error GoTo errEmailAttach

* * Dim oLook As Object
* * Dim oMail As Object
* * Dim i As Integer

* * Set oLook = CreateObject("O utlook.Applicat ion")
* * Set oMail = oLook.CreateIte m(0)
* * * * With oMail
* * * * * * .To = stSendTo
* * * * * * .Body = stBody
* * * * * * .Subject = stSubject
* * * * * * .ReadReceiptReq uested = True

* * * * * * If intAcount <0 Then
* * * * * * * * For i = 1 To intAcount
* * * * * * * * * * .Attachments.Ad d (astAttach(i - 1))
* * * * * * * * Next
* * * * * * End If

* * * * * * If intSend = True Then
* * * * * * * * .Send
* * * * * * Else
* * * * * * * * .Display
* * * * * * End If

* * * * End With

* * Set oMail = Nothing
* * Set oLook = Nothing
* * EmailAttach = True
* * Exit Function

errEmailAttach:

* * MsgBox "The following error was noted : " & Err.Description & Chr$(10) &
Chr$(13) & _
* * * * * *"Your email may not have been sent.", vbCritical, "Error"

* * On Error Resume Next
* * Set oMail = Nothing
* * Set oLook = Nothing
* * EmailAttach = False

End Function
Nov 20 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1378
by: Saintor | last post by:
On a local network, I have OFF2K and OFF XP. When I set it up, it was with XP and required Outlook library v10. Of course, it fails when open on a workstation with v9. Is there a way at db opening (1) to recognize what version is installed and (2) to activate the proper reference. I remembered about CDO v1.21. I gave a try to the method explained on mvps.org/access, but I keep getting a message and if CDO is not on
9
2778
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I have been commissioned to create a web-based application for a client. It has a formsaunthentication...
5
4453
by: | last post by:
Hi all, HttpWebRequest, and SoapHttpClientProtocol both expose a ClientCertificates property, which can hold multiple client certificates, but on the service side, it can only receive one client certificate, since it derives System.Web.Services.WebService class, and it's Context.Request.ClientCertificate is a single HttpClientCertificate object, is there a way to receive all the client certificates that is sent in the request? or does IIS...
17
1842
by: John | last post by:
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
3
8290
by: wizzbangca | last post by:
Hi everyone. Having problems with a utility I am writing for work. The previous IT Director thoughtfully allowed 3 (2000, xp, 2003) versions of outlook to be installed rather than 1. Now I need the utility to work for all 3 versions. A previous post suggested creating objects to detect the version of outlook, which I tried with success. But, that's as far as I can get. No one out there shows how to go beyond version detection to...
3
2084
by: AP | last post by:
I have an app that has one small component that uses a reference to MS Outlook 9.0 to create an email. Now we have users on 9.0 and 11.0, sometimes it causes the reference to switch and this causes the missing reference issue. What is the best way to get around this? Thanks
2
3674
by: Kosmos | last post by:
Alright so I've got this Outlook code written in VBA in Access. The first part, which works, records information about appointment times based on the required days before notification of certain contracts and then it adds them to the outlook calendar of the current user. This code works and is nested within a bunch of if statements because it only needs to trap certain appointments. The table I create with this code is later used to attempt to...
46
4371
by: Phil Reynolds | last post by:
I have Access 2000 and 2003 on my development machine. My client only has Access 2000. When I develop for this client, I run Access 2000. However, my code requires that I have the Microsoft Word Object Library and Microsoft Outlook Object Library listed in References. As I result, on my machine they're listed as version 11.0, and then, when I upload the file, they show as missing. So I have to go through the steps of removing the...
3
2968
by: Chet | last post by:
I am writing an application that utilizes a reference to Microsoft Outlook. (Added a reference to the MS Outlook COM interface to my project). I then write code such as: dim olApp as new Outlook.Applicaiton dim olNamespace as OutlOok.Namespace = olApp..... I am deploying my application via the "publish" feature that makes it downloadable and installable via the web.
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.