items.add error 3265

S

steve

hi

I having problems with adding an appointment item.

Dim oActiviteitenMap As MAPIFolder
Dim oAgenda As Outlook.AppointmentItem
Set oActiviteitenMap =
Application.GetNamespace("MAPI").Folders.Item("Activiteiten
Planner").Folders.Item("Agenda")

Set oAgenda = oActiviteitenMap.Items.Add

on the "set oAgenda = oactiviteitenMap.items.add" i get error 3265
I think its somting like can not find the collection with that name in
english.

what am i doing wrong?
Steve
 
S

Sue Mosher [MVP-Outlook]

For better troubleshooting, get each object separately and test for its existence:

Set ns = Application.GetNamespace("MAPI")
Set parentStore = ns.Folders.Item("Activiteiten Planner")
If Not parentStore Is Nothing Then
Set oActiviteitenMap = parentStore..Folders.Item("Agenda")
If Not oActiviteitenMap Is Nothing Then
Set oAgenda = oActiviteitenMap.Items.Add
End If
End If

With that kind of code structure, you'll quickly find errors such as non-available stores and folders

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Ken Slovak - [MVP - Outlook]

Check to see if you have a valid MAPIFolder object before you try to do
anything with any of its properties.
 
S

steve

Thanks for your help sue Mosher and ken slovak

I run the code you wrote but the strange thing is that on the
Set oAgenda = oActiviteitenMap.Items.Add
the vba debugger doesn't give me an error, it just stops executing the code.

I have run the code on another appointment folder that works fine.
Is there something I should look for when debugging?

Regards
Steve

"Sue Mosher [MVP-Outlook]" schreef:
 
S

Sue Mosher [MVP-Outlook]

What code follows that statement? Have you commented out any On Error statements?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



steve said:
Thanks for your help sue Mosher and ken slovak

I run the code you wrote but the strange thing is that on the
Set oAgenda = oActiviteitenMap.Items.Add
the vba debugger doesn't give me an error, it just stops executing the code.

I have run the code on another appointment folder that works fine.
Is there something I should look for when debugging?

Regards
Steve

"Sue Mosher [MVP-Outlook]" schreef:
For better troubleshooting, get each object separately and test for its existence:

Set ns = Application.GetNamespace("MAPI")
Set parentStore = ns.Folders.Item("Activiteiten Planner")
If Not parentStore Is Nothing Then
Set oActiviteitenMap = parentStore..Folders.Item("Agenda")
If Not oActiviteitenMap Is Nothing Then
Set oAgenda = oActiviteitenMap.Items.Add
End If
End If

With that kind of code structure, you'll quickly find errors such as non-available stores and folders
 
S

steve

Hi Sue

This is the code I debugged
I've put this in a separate module and with F8 debugged the procedure

I even used the item number of the collection as reference
no on error code is used.

I'm using outlook 2002

Sub test()
Dim ns As NameSpace
Dim parentstore As MAPIFolder
Dim oActiviteitenMap As MAPIFolder
Dim oAgenda As AppointmentItem
Set ns = Application.GetNamespace("MAPI")
Set parentstore = ns.Folders.Item("Activiteiten Planner")
If Not parentstore Is Nothing Then
Set oActiviteitenMap = parentstore.Folders.Item("Agenda")
If Not oActiviteitenMap Is Nothing Then
Set oAgenda = oActiviteitenMap.Items.Add
oAgenda.BillingInformation = "test"
End If
End If

End Sub

Steve


"Sue Mosher [MVP-Outlook]" schreef:
What code follows that statement? Have you commented out any On Error statements?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



steve said:
Thanks for your help sue Mosher and ken slovak

I run the code you wrote but the strange thing is that on the
Set oAgenda = oActiviteitenMap.Items.Add
the vba debugger doesn't give me an error, it just stops executing the code.

I have run the code on another appointment folder that works fine.
Is there something I should look for when debugging?

Regards
Steve

"Sue Mosher [MVP-Outlook]" schreef:
For better troubleshooting, get each object separately and test for its existence:

Set ns = Application.GetNamespace("MAPI")
Set parentStore = ns.Folders.Item("Activiteiten Planner")
If Not parentStore Is Nothing Then
Set oActiviteitenMap = parentStore..Folders.Item("Agenda")
If Not oActiviteitenMap Is Nothing Then
Set oAgenda = oActiviteitenMap.Items.Add
End If
End If

With that kind of code structure, you'll quickly find errors such as non-available stores and folders

hi

I having problems with adding an appointment item.

Dim oActiviteitenMap As MAPIFolder
Dim oAgenda As Outlook.AppointmentItem
Set oActiviteitenMap =
Application.GetNamespace("MAPI").Folders.Item("Activiteiten
Planner").Folders.Item("Agenda")

Set oAgenda = oActiviteitenMap.Items.Add

on the "set oAgenda = oactiviteitenMap.items.add" i get error 3265
I think its somting like can not find the collection with that name in
english.

what am i doing wrong?
Steve
 
S

steve

I think I've found the error
yesterday if was looking on the KBs for a way to block the error message I
got everytime I made a new appointment item and closed outlook.
I found this
http://support.microsoft.com/?kbid=905814

If I make the changes to the registry the code won't work.
Deleted the key and restarting outlook, the code works
Is strange is't only on that folder

Is there a better way to get past these messages?

Steve


"Sue Mosher [MVP-Outlook]" schreef:
What code follows that statement? Have you commented out any On Error statements?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



steve said:
Thanks for your help sue Mosher and ken slovak

I run the code you wrote but the strange thing is that on the
Set oAgenda = oActiviteitenMap.Items.Add
the vba debugger doesn't give me an error, it just stops executing the code.

I have run the code on another appointment folder that works fine.
Is there something I should look for when debugging?

Regards
Steve

"Sue Mosher [MVP-Outlook]" schreef:
For better troubleshooting, get each object separately and test for its existence:

Set ns = Application.GetNamespace("MAPI")
Set parentStore = ns.Folders.Item("Activiteiten Planner")
If Not parentStore Is Nothing Then
Set oActiviteitenMap = parentStore..Folders.Item("Agenda")
If Not oActiviteitenMap Is Nothing Then
Set oAgenda = oActiviteitenMap.Items.Add
End If
End If

With that kind of code structure, you'll quickly find errors such as non-available stores and folders

hi

I having problems with adding an appointment item.

Dim oActiviteitenMap As MAPIFolder
Dim oAgenda As Outlook.AppointmentItem
Set oActiviteitenMap =
Application.GetNamespace("MAPI").Folders.Item("Activiteiten
Planner").Folders.Item("Agenda")

Set oAgenda = oActiviteitenMap.Items.Add

on the "set oAgenda = oactiviteitenMap.items.add" i get error 3265
I think its somting like can not find the collection with that name in
english.

what am i doing wrong?
Steve
 
S

Sue Mosher [MVP-Outlook]

Maybe not strange at all if the folder you're working with is in someone else's Domino calendar.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



steve said:
I think I've found the error
yesterday if was looking on the KBs for a way to block the error message I
got everytime I made a new appointment item and closed outlook.
I found this
http://support.microsoft.com/?kbid=905814

If I make the changes to the registry the code won't work.
Deleted the key and restarting outlook, the code works
Is strange is't only on that folder

Is there a better way to get past these messages?

Steve


"Sue Mosher [MVP-Outlook]" schreef:
What code follows that statement? Have you commented out any On Error statements?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



steve said:
Thanks for your help sue Mosher and ken slovak

I run the code you wrote but the strange thing is that on the
Set oAgenda = oActiviteitenMap.Items.Add
the vba debugger doesn't give me an error, it just stops executing the code.

I have run the code on another appointment folder that works fine.
Is there something I should look for when debugging?

Regards
Steve

"Sue Mosher [MVP-Outlook]" schreef:

For better troubleshooting, get each object separately and test for its existence:

Set ns = Application.GetNamespace("MAPI")
Set parentStore = ns.Folders.Item("Activiteiten Planner")
If Not parentStore Is Nothing Then
Set oActiviteitenMap = parentStore..Folders.Item("Agenda")
If Not oActiviteitenMap Is Nothing Then
Set oAgenda = oActiviteitenMap.Items.Add
End If
End If

With that kind of code structure, you'll quickly find errors such as non-available stores and folders

hi

I having problems with adding an appointment item.

Dim oActiviteitenMap As MAPIFolder
Dim oAgenda As Outlook.AppointmentItem
Set oActiviteitenMap =
Application.GetNamespace("MAPI").Folders.Item("Activiteiten
Planner").Folders.Item("Agenda")

Set oAgenda = oActiviteitenMap.Items.Add

on the "set oAgenda = oactiviteitenMap.items.add" i get error 3265
I think its somting like can not find the collection with that name in
english.

what am i doing wrong?
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top