J
Jim Burke in Novi
I have been using early binding to access outlook (using tools, references to
set a reference to Outlook). When I try to use late bnding I get an error
message.
Here are the statements I use to get at the appointments:
Dim objOutlook As Outlook.Application
Dim allApptItems As Outlook.Items
Set objOutlook = New Outlook.Application
Set allApptItems =
objOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
This works fine. I can loop through all appointment items. But when I change
to the following I get error message 'Could not complete the operation. One
or more parameter values are not valid.' It happens on the Set statement for
the items.
Dim objOutlook As Object
Dim allApptItems As Object
Set objOutlook = CreateObject("Outlook.Application")
Set allApptItems =
objOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
This technique (remove reference and declare variables as objects) works OK
for me when I open Excel from Access, but there must be some extra step I
need for Outlook that I'm missing. Any ideas?
set a reference to Outlook). When I try to use late bnding I get an error
message.
Here are the statements I use to get at the appointments:
Dim objOutlook As Outlook.Application
Dim allApptItems As Outlook.Items
Set objOutlook = New Outlook.Application
Set allApptItems =
objOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
This works fine. I can loop through all appointment items. But when I change
to the following I get error message 'Could not complete the operation. One
or more parameter values are not valid.' It happens on the Set statement for
the items.
Dim objOutlook As Object
Dim allApptItems As Object
Set objOutlook = CreateObject("Outlook.Application")
Set allApptItems =
objOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
This technique (remove reference and declare variables as objects) works OK
for me when I open Excel from Access, but there must be some extra step I
need for Outlook that I'm missing. Any ideas?