A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

for each MyItem in myFolder.Items=HRESULT: 0x80004002 (E_NOINTERFA



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 13th 07, 09:34 AM posted to microsoft.public.outlook.program_vba
HelixX23[_2_]
external usenet poster
 
Posts: 11
Default for each MyItem in myFolder.Items=HRESULT: 0x80004002 (E_NOINT

Ok... i´ll try...

"Peter Marchert" wrote:

Only an idea: Can you reproduce this behaviour on another machine and/
or with a different store? Perhaps the installation in a virtual pc
will help you to find out more.

Peter

--
Infos, workshops & soft-
ware for your Outlook®:
www.outlook-stuff.com


On 12 Sep., 12:38, HelixX23
wrote:
Hi...
thanks for reply...

Yes.
I tried to Collect Garbage inside the loop, before loop and inside, and
after every 245 items, but none of this works...

greetz from germany
HelixX²³



"Dmitry Streblechenko" wrote:
Hmmm... I don't know. Somethign else is going on that is causing .Net to
hold on to the items.
Have you tried to call GC.Collect() inside the loop?


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"HelixX23" wrote in message
...
Yes...


There are only ContactItems in myContactFolder.
There are no Distributionlists in there... the only thing is... there are
subfolders in myContactFolder but subfolders are in the
myContactFolder.Folders() Collection and not in the myContactFolder.Items
Collection.
And all Items are at the same customForm (IPM.Contact.myCustomName)


"Dmitry Streblechenko" wrote:


And do you have *only* contacts in that older, no DLs?


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"HelixX23" wrote in message
...
Hi...
thanks for reply


Sure... i tried it twice...
once with myItem as Outlook.ContactItem adn once with myItem as
Object...
both fails... dont know why..


greetz HelixX²³


"Dmitry Streblechenko" wrote:


Did you remember to declare myItem as Outlook.ContactItem rather than
the
generic Object?


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"HelixX23" wrote in message
...
Hi...


So i tried this... but it fails also...


"
myContactFolderItems = myContactFolder.Items
For i As Integer = 1 To myContactFolderItems.Count
myItem = myContactFolderItems.Item(i)
Marshal.ReleaseComObject(myItem)
Next i
"


i = 250 as integer


Das COM-Objekt des Typs "System.__ComObject" kann nicht in den
Schnittstellentyp "Microsoft.Office.Interop.Outlook.ContactItem"
umgewandelt
werden. Dieser Vorgang konnte nicht durchgeführt werden, da der
QueryInterface-Aufruf an die COM-Komponente für die Schnittstelle
mit
der
IID
"{00063021-0000-0000-C000-000000000046}" aufgrund des folgenden
Fehlers
nicht
durchgeführt werden konnte: Schnittstelle nicht unterstützt
(Ausnahme
von
HRESULT: 0x80004002 (E_NOINTERFACE)).


What am i doing wrong?


Maybe i should release the whole Outlook Application from my
harddrive...
(joke)


greets HelixX23


"Dmitry Streblechenko" wrote:


Try to remove everything from the loop and see if it runs Ok or
fails
with
the same problem.


myContactFolderItems = myContactFolder.Items
For i As Integer = 1 To myContactFolderItems.Count
myItem = myContactFolderItems.Item(i)
Marshal.ReleaseComObject(myItem)
Next i


Also, why do you keep recalculating
myContactFolderItems = myContactFolder.Items
*inside* the loop?


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"HelixX23" wrote in message
...
I tried to declare myItem as Outlook.ContactItem but this fails
also...
something is wrong with the Garbage Collector... its not
collecting
anything...
I also tried to start the Garbage Collector before that function
and
after
the 245´s Item but it fails also.


are there maybe any working examples how to successfully
releaseComObjects
under an "exchange folder Items cycle"?


greets HelixX23


"Dmitry Streblechenko" wrote:


I can only guess tah t since you declare myItem as a generic
Object,
teh
compiler QI's it for IDispatch every timee and does not release
the
reference.
Can you try to declare it as ContactItem (assuming you do not
have
any
DLs
in that folder)?


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"HelixX23" wrote in message
...
Hi...
Thanks for the reply Dmitry.


something is getting better...
the failure changed the line...
maybe it is not explicitely declared enough??


[code]
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core
Imports Outlook = Microsoft.Office.Interop.Outlook
Imports Microsoft.VisualBasic.Information


Public Class SearchAndReplace


Public myContactFolder As Outlook.MAPIFolder '=
Outlook.Application.GetNamespace("MAPI").folders(" Öffetnliche
Ordner").folders("Alle Öffentlichen Ordner").folders("EUKON
Kontakte")
Private Sub btnPickOLFolder_Click(ByVal sender As
System.Object,
ByVal
e
As System.EventArgs) Handles btnPickOLFolder.Click
Dim myOlApp As Outlook.Application =
CreateObject("Outlook.Application")
Dim myNamespace As Outlook.NameSpace =
myOlApp.GetNamespace("MAPI")
myContactFolder = myNamespace.PickFolder
If myContactFolder Is Nothing Then MsgBox("Sie haben
keinen
Ordner
ausgewählt...?") : Exit Sub
txtOutlookFolder.Text = myContactFolder.FolderPath
End Sub


Private Sub btnSearchAll_Click(ByVal sender As
System.Object,
ByVal
e
As
System.EventArgs) Handles btnSearchAll.Click
SearchALL()
End Sub


Private Sub SearchALL()
Dim myContactFolderItems As Outlook.Items =
myContactFolder.Items
Dim myItem As Object
Dim countItems As Integer = myContactFolderItems..Count
Dim myItemCategories As Object
Dim myItemFileAs As String


pgbSearchAndReplace.Enabled = True
pgbSearchAndReplace.Minimum = 0
pgbSearchAndReplace.Maximum =
myContactFolder.Items.Count
pgbSearchAndReplace.Value = 0


MsgBox("Items.Count = " & countItems)


For i As Integer = 1 To countItems
pgbSearchAndReplace.Value = i ' my Progressbar


Debug.Print("Memory: " & GC.GetTotalMemory(True))
Debug.Print("generate Object")


myContactFolderItems = myContactFolder.Items
myItem = myContactFolderItems.Item(i) ' old failure
has
passed
when "i as int = 250"
myItemCategories = myItem.Categories ' new failure
drops
here...
? not explicite enough?
myItemFileAs = myItem.FileAs.ToString


Debug.Print("Memory: " & GC.GetTotalMemory(True))


If TypeName(myItem) = "ContactItem" Then


If InStr(myItemCategories, txtSearch.Text,
CompareMethod.Text) Then
lstSearchResults.Items.Add(myItemFileAs &
" -
" &
myItemCategories)
End If
Else
MsgBox(TypeName(myItem))
End If


' Try to release ComObjects
ReleaseMyComObject(myItem)
ReleaseMyComObject(myContactFolderItems)
ReleaseMyComObject(myItemCategories)
ReleaseMyComObject(myItemFileAs)


...

Erfahren Sie mehr »- Zitierten Text ausblenden -

- Zitierten Text anzeigen -




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Operation aborted (Exception from HRESULT: 0x80004004) Kulvinder Add-ins for Outlook 3 November 27th 07 12:42 PM
Problem using Myitem.UserProperties.Find("string") John E. Outlook and VBA 3 January 3rd 07 04:12 PM
how to retain 10 days items in Outlook 2003 deleted items folder? Balthazar Outlook - Installation 2 June 7th 06 04:05 PM
Exception from HRESULT Laks Add-ins for Outlook 1 May 11th 06 09:24 AM
Inbox, Sent Items & Outbox in Deleted Items in Outlook 2003 & OWA with Exchange splounx Outlook - General Queries 1 February 17th 06 02:22 AM


All times are GMT +1. The time now is 06:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.