error retrieving folder.items.count

  • Thread starter Thread starter kappe79
  • Start date Start date
K

kappe79

Trying to access to the properties "items.count" of a
outlook.MAPIfolder I received a message error (sorry, the comments are
in italian, however the message says that "an unknow error has
occurred" and it suggest to re-start outlook):

System.Runtime.InteropServices.COMException non è stata gestita
ErrorCode=-1525661691
Message="Errore sconosciuto dell'interfaccia di trasferimento
messaggi. Se il problema persiste, riavviare Outlook."
Source="Microsoft Office Outlook"
StackTrace:
in Outlook.ItemsClass.get_Count()
in GestionePostaElettronica.FrmMail.Button1_Click_1(Object
sender, EventArgs e)

The single items of the Mapifolder are accessible but i need to know
the number of it
The folder in located in a Exchange Server: may the reason of the
problem be this?

thanks for any help
 
I've realized that the problem seem to be caused by the fact that
sometimes (i think randomly) the MAPIFolder Object lose the connection
with the folder placed in Exchange sever (the folder has more than 2000
postitem....).
The problem does not appear if i use a local folder.
Is this a problem related with Exchange Server?
i'll try to make a serch on the web, however, if someone know a
solution about this....
I'have used also Redemption but with no luck.

thanks
 
That should not happen. If you re-instantiate the MAPIFolder object does
that work?

Are you sure that your MAPIFolder object variable isn't going out of scope
or being garbage collected? Put it at module level in a class or code module
that is always in scope and make sure it really stays in scope the entire
time you need to access it.
 
I try to scope the MAPIfolder and effectively it doesn't loose the
connection with the folder however, after a certain number of iteration
among the items of the mapifolder, the properties "items" become
inaccessible, giving the error i mentioned before.
I'm programming using Visual basic 2005 express edition. The strange
thing is that the same code works fine if i put it in a macro directly
inside outlook.

For now I'll used this macro...

bye

A.D.F.

Ken Slovak - [MVP - Outlook] ha scritto:
 
Back
Top