Outlook Notes delete

R

Roger Odermatt

Hello

How can delete all Notes in the Outlook?

I try it with this code, but no success.

------
Dim oApp As New Outlook.Application
Dim oNotes As Outlook.MAPIFolder
Dim oNameSpace As Outlook.NameSpace

oNameSpace = oApp.GetNamespace("MAPI")
oNotes = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderNotes)

Dim i As Integer

For i = 0 To oNotes.Items.Count - 1
oNotes.Items.Remove(i)
Next
------

Can anybody help me?

regards
Roger
 
K

Ken Tucker [MVP]

Hi,

Try starting with the last note first.

Ken
--------------
Hello

How can delete all Notes in the Outlook?

I try it with this code, but no success.

------
Dim oApp As New Outlook.Application
Dim oNotes As Outlook.MAPIFolder
Dim oNameSpace As Outlook.NameSpace

oNameSpace = oApp.GetNamespace("MAPI")
oNotes = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderNotes)

Dim i As Integer

For i = 0 To oNotes.Items.Count - 1
oNotes.Items.Remove(i)
Next
------

Can anybody help me?

regards
Roger
 

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