Solved

Can I refer two appointmentItem refer to the same outlook calendar folder

Posted on 2002-05-08
2
129 Views
Last Modified: 2010-04-08
HI,

Can I refer two appointmentItem refer to the same outlook calendar folder

I have code something like this

"general declaration "

Public objOutlook As Outlook.Application
Dim mNameSpace As Outlook.NameSpace

"In form load "

Set objOutlook = CreateObject("Outlook.Application")
Set mNameSpace = objOutlook.GetNamespace("Mapi")

"In sub MySub"

Dim AppItem As Outlook.AppointmentItem
Dim  FilterAppItem  As Outlook.AppointmentItem

 Set AppItem = mNameSpace.GetDefaultFolder(olFolderCalendar).Items()
         Set FilterAppItem = mNameSpace.GetDefaultFolder(olFolderCalendar).Items()


In MySub first line excutes perfectly W/O any problem , but in the second line of code ie

Set FilterAppItem = mNameSpace.GetDefaultFolder(olFolderCalendar).Items()

It throws an error "Run time Error 13   Type mismatch"

Can any one tells the reason for this.

If this is not correct, How to iterate in the AppointmentItems

TIA

Prashanth Kiran G

0
Comment
Question by:PrashanthKiran
  • 2
2 Comments
 
LVL 8

Accepted Solution

by:
jessnjeff earned 100 total points
Comment Utility
appitem & filterappitem must be "items", once you get the items in a folder you can get your individual appointment item
0
 
LVL 8

Expert Comment

by:jessnjeff
Comment Utility
Dim mItem As outlook.AppointmentItem
Dim mFItem As outlook.AppointmentItem



For Each mItem In AppItem
do my stuff
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now