This thread has been something of an eye opener for me. I was blissfully
(and ignorantly) using the Outlook and Excel library references. I've
gotten the app to work without the Outlook library, Excel will be a bit of a
bigger job (used extensively with lots of XL constants).
If you don't mind, I have a couple more questions. Is eliminating the use
of the references (as suggested) the same thing as late binding? What
impact, if any, is this change likely to have on performance? What impact,
if any, is the change likely to have on the size of the final application
(MDE)?
Thanks, once again, for all of the help
Randy Harris
Randy Harris said:
Dan, are you saying that using the method you described below, I would then
never need the reference for the finished application? Would that then make
an MDE completely independent of the version of Outlook installed on the
client workstation?
Thanks in advance for helping out those of us still coming up to speed on
these technologies.
Dan Artuso said:
Hi,
Outlook Object Library 9.0 *is* Outlook.
If you don't have that version installed then you
can't reference it.
The trick is to use late binding, that way you don't set
a reference to any version of Outlook.
Here is a little snippet:
Dim olNameSpace As Object
Dim olFolders As Object
Dim olCalFolder As Object
Dim olApp As Object
Dim olItems As Object
Dim olAppItem As Object
Dim strText As String
Set olApp = CreateObject("Outlook.Application")
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olCalFolder = olNameSpace.GetDefaultFolder(olFolderCalendar)
'these next two lines get a reference to my test calendar
Set olFolders = olNameSpace.Folders.Item("personal calendar")
Set olAppItem = olCalFolder.Items.Add(olAppointmentItem)
What I do is I set a reference for the initial development so I get
the
intelisense,
then I remove the reference, make sure everything is Dimmed as Object
and
use CreateObject when I'm done.