H
HARI
Hi!
I'm trying to delete a few (well about 1000) contact items from my
default contacts folder.
I do it with something like that in VB.NET:
Dim oOtk As New Outlook.Application
Dim NS As Outlook.NameSpace = oOtk.GetNamespace("MAPI")
Dim fContacts As Outlook.Folder =
NS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
anz = fContacts.Items.Count
For i As Integer = anz To 1 Step -1
fContacts.Items.Remove(i)
Next
This works fine when I try the same in Outlook VBA.
In my VB.NET Application it also seems to run at first, deleting some
100 of the contacts but there always occurs an exception before
finishing it:
"System.Runtime.InteropServices.COMException (0x80040305): Die Anzahl
der Elemente, die gleichzeitig geöffnet werden können, wurde vom
Serveradministrator begrenzt. Schließen Sie zunächst geöffnete
Nachrichten, oder entfernen Sie Anhänge und Bilder von ungesendeten
Nachrichten, die Sie gerade verfassen.
bei
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn)
bei
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
IgnoreReturn)
bei Tel2Otk2007.frmTel2Otk2007.myBGW_DoWork(Object sender,
DoWorkEventArgs e)"
Sorry for the German Message which says something like there is a
restriction of the number of elements which can be open simultaniously
and that I should close some opened Messages. But I don't open any, I
just want to delete them.
Do you have any Idea how to handle with that problem?
Cheers,
HARI
I'm trying to delete a few (well about 1000) contact items from my
default contacts folder.
I do it with something like that in VB.NET:
Dim oOtk As New Outlook.Application
Dim NS As Outlook.NameSpace = oOtk.GetNamespace("MAPI")
Dim fContacts As Outlook.Folder =
NS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
anz = fContacts.Items.Count
For i As Integer = anz To 1 Step -1
fContacts.Items.Remove(i)
Next
This works fine when I try the same in Outlook VBA.
In my VB.NET Application it also seems to run at first, deleting some
100 of the contacts but there always occurs an exception before
finishing it:
"System.Runtime.InteropServices.COMException (0x80040305): Die Anzahl
der Elemente, die gleichzeitig geöffnet werden können, wurde vom
Serveradministrator begrenzt. Schließen Sie zunächst geöffnete
Nachrichten, oder entfernen Sie Anhänge und Bilder von ungesendeten
Nachrichten, die Sie gerade verfassen.
bei
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn)
bei
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
IgnoreReturn)
bei Tel2Otk2007.frmTel2Otk2007.myBGW_DoWork(Object sender,
DoWorkEventArgs e)"
Sorry for the German Message which says something like there is a
restriction of the number of elements which can be open simultaniously
and that I should close some opened Messages. But I don't open any, I
just want to delete them.
Do you have any Idea how to handle with that problem?
Cheers,
HARI