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

Redemption Inbox problem + instability



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 4th 06, 08:42 PM posted to microsoft.public.outlook.program_vba
mirzoni
external usenet poster
 
Posts: 1
Default Redemption Inbox problem + instability


I have an app that uses redemption and mapi to access the emails in an
exchange mailbox.

Redemption:
Dim FolderItemsREDInbox As Redemption.RDOFolder
FolderItemsREDInbox = session.GetDefaultFolder(6)
(loads OK)

mapi:
Dim Folder As Outlook.MAPIFolder = oNS.GetDefaultFolder(6)
Dim FolderItems As Outlook.Items = Folder.Items
(also loads OK)

(note that both are pointing to the Inbox)
however, then i do the following:

Dim HowManyItemsREDInbox As Integer
HowManyItemsREDInbox = FolderItemsRED.Items.Count
i get: HowManyItemsREDInbox = 25

and
Dim HowManyItemsMAPIInbox As Integer
HowManyItemsMAPIInbox = FolderItems.Count
i get: HowManyItemsMAPIInbox = 50

how can this be? this is really mesing up some things for me over here!


ALSO:
when I load 500+ items redemptions becomes unstable by errors occurring
randomly.
( as per recommendations on the official redemption site i have used:
I have used a global var for the redemption instance
+
i have MS Outlook 2003 SP3 (11.6568.6568 version)
)

can anyone out there shed some light on these two issues?

Regards


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in

Ads
  #2  
Old December 5th 06, 07:13 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption Inbox problem + instability

What is the real item count as reported by Outlook itself? Are you sure both
Redemption and Outlook are using the same MAPI profile?
Since you are using .Net, most likely you are running out of the 255 RPC
channels limit imposed by Exchange. .Net does not immediately release COM
objects, you need to do that explicitly using Marshal.ReleaseCOMObject() in
the loop. Avoid using multiple "." notation to make sure there are no
implicit variables created by the compiler.

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

"mirzoni" wrote in message
...

I have an app that uses redemption and mapi to access the emails in an
exchange mailbox.

Redemption:
Dim FolderItemsREDInbox As Redemption.RDOFolder
FolderItemsREDInbox = session.GetDefaultFolder(6)
(loads OK)

mapi:
Dim Folder As Outlook.MAPIFolder = oNS.GetDefaultFolder(6)
Dim FolderItems As Outlook.Items = Folder.Items
(also loads OK)

(note that both are pointing to the Inbox)
however, then i do the following:

Dim HowManyItemsREDInbox As Integer
HowManyItemsREDInbox = FolderItemsRED.Items.Count
i get: HowManyItemsREDInbox = 25

and
Dim HowManyItemsMAPIInbox As Integer
HowManyItemsMAPIInbox = FolderItems.Count
i get: HowManyItemsMAPIInbox = 50

how can this be? this is really mesing up some things for me over here!


ALSO:
when I load 500+ items redemptions becomes unstable by errors occurring
randomly.
( as per recommendations on the official redemption site i have used:
I have used a global var for the redemption instance
+
i have MS Outlook 2003 SP3 (11.6568.6568 version)
)

can anyone out there shed some light on these two issues?

Regards


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in



  #3  
Old December 5th 06, 08:48 PM posted to microsoft.public.outlook.program_vba
mirzoni
external usenet poster
 
Posts: 1
Default Redemption Inbox problem + instability


Hi Dmitry,

Thanks for you reply!
The actual numbers a
MAPI:6310
REDEMPTION:6305


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in

  #4  
Old December 5th 06, 09:41 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption Inbox problem + instability

1.What does Outlook show for that folder?
2. Are you sure you end up using the same MAPI profile?
3. Are both cases online or cached?
4. What happens if instead of calling RDOSession.Logon you set
RDOSession.MAPIOBJECT ot Session.RDOSession from CDO?

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

"mirzoni" wrote in message
...

Hi Dmitry,

Thanks for you reply!
The actual numbers a
MAPI:6310
REDEMPTION:6305


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in



  #5  
Old December 7th 06, 03:27 PM posted to microsoft.public.outlook.program_vba
mirzoni
external usenet poster
 
Posts: 1
Default Redemption Inbox problem + instability


Hi Dmitri,

Thanks for you reply!

I am not sure what do you mean by:
4. What happens if instead of calling RDOSession.Logon you set
RDOSession.MAPIOBJECT ot Session.RDOSession from CDO?

here is what I run to get to the information:


'...logging on exchange...


'redemption
Dim session As New Redemption.RDOSession
session = CreateObject("Redemption.RDOSession")
session.LogonExchangeMailbox(MailBoxName, Server)

Dim FolderItemsRED As Redemption.RDOFolder
FolderItemsRED = session.GetDefaultFolder(6)

dim redcount as integer
redcount = FolderItemsRED.Items.Count
'this gives me 11


'mapi
Dim outlook_Profile As String = MailBoxName
Dim oSession As New MAPI.Session
oApp = New Outlook.Application
oNS = oApp.GetNamespace("mapi")

oNS.Logon(outlook_Profile, , False, True)

Dim Folder As Outlook.MAPIFolder = oNS.GetDefaultFolder(6)
Dim FolderItemsW As Outlook.Items = Folder.Items

dim mapicount as integer
mapicount = FolderItemsW.count
'this gives me 4039

Please let me know what is the other way to log on.

Thanks again!


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in

  #6  
Old December 7th 06, 06:37 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption Inbox problem + instability

How about questions 1 through 3?
When you call RDOSession.LogonExchangeMailbox, Redemption creates a
temporary profile with an online (as opposed to cached) store. This is
similar to using Session.Login with ProfileInfo parameter used in CDO 1.21.
4a. What happens if you call RDOSession.Logon(outlook_Profile)?
4b. What happens if you run your OOM code first, then instead of calling
session.LogonExchangeMailbox call
session.MAPIOBJECT = oNS.MAPIOBJECT?
This way both Outlook and Redemption will be using the same physical MAPI
session.

I bet the existing profile (outlook_Profile) uses cached mode, while
LogonExchangeMailbox() will give you aan online store, which can be
different.

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

"mirzoni" wrote in message
...

Hi Dmitri,

Thanks for you reply!

I am not sure what do you mean by:
4. What happens if instead of calling RDOSession.Logon you set
RDOSession.MAPIOBJECT ot Session.RDOSession from CDO?

here is what I run to get to the information:


'...logging on exchange...


'redemption
Dim session As New Redemption.RDOSession
session = CreateObject("Redemption.RDOSession")
session.LogonExchangeMailbox(MailBoxName, Server)

Dim FolderItemsRED As Redemption.RDOFolder
FolderItemsRED = session.GetDefaultFolder(6)

dim redcount as integer
redcount = FolderItemsRED.Items.Count
'this gives me 11


'mapi
Dim outlook_Profile As String = MailBoxName
Dim oSession As New MAPI.Session
oApp = New Outlook.Application
oNS = oApp.GetNamespace("mapi")

oNS.Logon(outlook_Profile, , False, True)

Dim Folder As Outlook.MAPIFolder = oNS.GetDefaultFolder(6)
Dim FolderItemsW As Outlook.Items = Folder.Items

dim mapicount as integer
mapicount = FolderItemsW.count
'this gives me 4039

Please let me know what is the other way to log on.

Thanks again!


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in



  #7  
Old December 7th 06, 08:27 PM posted to microsoft.public.outlook.program_vba
mirzoni
external usenet poster
 
Posts: 1
Default Redemption Inbox problem + instability


Hi Dimirty,

Man, thanks for that!

This worked:
session.MAPIOBJECT = oNS.MAPIOBJECT
(now it totally makes sense)

Now i've got stuck on the next part!
In this app, after login, i create a new folder: rootscanned(date and
time)
and place the redemption mailitems one by one in that folder... simple
right?

When I used the session.LogonExchangeMailbox(MailBoxName, Server) I
could execute the move however now I can not.

...
session.MAPIOBJECT = oNS.MAPIOBJECT
Dim ScanFolder As Redemption.RDOFolder

Dim DateAndTimeNOW As String
DateAndTimeNOW = Now()
ScanFolder =
session.Stores.DefaultStore.IPMRootFolder.Folders( "Scanned").Folders.Add(DateAndTimeNOW)

Dim FolderItemsRED As Redemption.RDOFolder
FolderItemsRED = session.GetDefaultFolder(6)

Dim MailTo As Redemption.RDOMail
For i = 1 To FolderItemsRED.Items.Count
MailTo = FolderItemsRED.Items(i)
MailTo.Move(ScanFolder)
next i
....
the app dies on: MailTo.Move(ScanFolder)

please disregard the fact that when the "i' gets to
(FolderItemsRED.Items.Count/2) that the app will break.
this is because items are getting moved to another folder so the "i"
reference will go above the actual count. I have another more complex
routine that handles that issue but in this case I have shortened it
for the purpose of clarity and getting to the bottom of why does the
app break on:
MailTo.Move(ScanFolder).

please help


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in

  #8  
Old December 7th 06, 09:44 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption Inbox problem + instability

What is the *exact* error?
How do you decide which items get copied where? Your code will not copy the
first half of the items, it will copy every second one.
Also note that your code will be a lot tmore efficient if you cache the
value of FolderItemsRED.Items rather than call it on each step of the loop;
you will get a brand new COM object each time.

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

"mirzoni" wrote in message
...

Hi Dimirty,

Man, thanks for that!

This worked:
session.MAPIOBJECT = oNS.MAPIOBJECT
(now it totally makes sense)

Now i've got stuck on the next part!
In this app, after login, i create a new folder: rootscanned(date and
time)
and place the redemption mailitems one by one in that folder... simple
right?

When I used the session.LogonExchangeMailbox(MailBoxName, Server) I
could execute the move however now I can not.

..
session.MAPIOBJECT = oNS.MAPIOBJECT
Dim ScanFolder As Redemption.RDOFolder

Dim DateAndTimeNOW As String
DateAndTimeNOW = Now()
ScanFolder =
session.Stores.DefaultStore.IPMRootFolder.Folders( "Scanned").Folders.Add(DateAndTimeNOW)

Dim FolderItemsRED As Redemption.RDOFolder
FolderItemsRED = session.GetDefaultFolder(6)

Dim MailTo As Redemption.RDOMail
For i = 1 To FolderItemsRED.Items.Count
MailTo = FolderItemsRED.Items(i)
MailTo.Move(ScanFolder)
next i
...
the app dies on: MailTo.Move(ScanFolder)

please disregard the fact that when the "i' gets to
(FolderItemsRED.Items.Count/2) that the app will break.
this is because items are getting moved to another folder so the "i"
reference will go above the actual count. I have another more complex
routine that handles that issue but in this case I have shortened it
for the purpose of clarity and getting to the bottom of why does the
app break on:
MailTo.Move(ScanFolder).

please help


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in



  #9  
Old December 8th 06, 02:42 PM posted to microsoft.public.outlook.program_vba
mirzoni
external usenet poster
 
Posts: 1
Default Redemption Inbox problem + instability


hi,
thanks for you help.
here is the copy of the error:

++++++++++++++++++

System.Runtime.InteropServices.COMException occurred
ErrorCode=-2147417852
Message="Error in IMsgServiceAdmin::AdminProviders: RPC_E_FAULT"
Source="Redemption.RDOReportItem"
StackTrace:
at Redemption.RDOMailClass.Move(RDOFolder DestFolder)
at EmailScanner.ScanManager.LoadRawMessageMAPI(Items&
FolderItems)

++++++++++++++++++

this started when this: session.MAPIOBJECT = oNS.MAPIOBJECT
was added and this: session.LogonExchangeMailbox(MailBoxName, Server)
was taken out.


++++++++++++++++++
i looked up this error on google and found the following:
http://peach.ease.lsoft.com/scripts/...-l&T=0&P=18593

...
Is your code running as a separate exe rather than an Outlook
add-in/extension?
There are quite a few bugs in MAPI when it comes to marshalling
IMAPISession
across the process boundaries - you will get back the RPC_E_FAULT error
when
you touch the profiles API (IProfAdmin etc) or call Imessage::CopyTo()
or
open the ACL table under Exchange.
Make sure that IMAPISession lives in your process address space so that
it
won't have to be marshalled - use MAPILogonEx() to retrieve
IMAPISession
instead of reading it from Namespace.MAPIOBJECT.
...
++++++++++++++
now, since i HAVE to use session.MAPIOBJECT = oNS.MAPIOBJECT (as only
that brings me back good results) is there a way to move these messages
to another folder? is there a way out?


again, thanks for you help.


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in

  #10  
Old December 8th 06, 05:51 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption Inbox problem + instability

Nope, you need to use RDOSession.Logon/LogonExchangeMailbox instead of
setting the MAPIOBJECT property - there's a marshalling bug in MAPI, nothing
Redemption can do. AFAIK that was fixed in Outlook 2007.
As a workaround, you can create a new message in the target folder
explicitly (RDOFolder.Items.Add), then call RDOMail.CopyTo(), then
RDOMail.Delete. Just keep in mind that doing so instead of calling MoveTo()
does not preserve created and last modified dates.
Why can't you use Logon?

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

"mirzoni" wrote in message
...

hi,
thanks for you help.
here is the copy of the error:

++++++++++++++++++

System.Runtime.InteropServices.COMException occurred
ErrorCode=-2147417852
Message="Error in IMsgServiceAdmin::AdminProviders: RPC_E_FAULT"
Source="Redemption.RDOReportItem"
StackTrace:
at Redemption.RDOMailClass.Move(RDOFolder DestFolder)
at EmailScanner.ScanManager.LoadRawMessageMAPI(Items&
FolderItems)

++++++++++++++++++

this started when this: session.MAPIOBJECT = oNS.MAPIOBJECT
was added and this: session.LogonExchangeMailbox(MailBoxName, Server)
was taken out.


++++++++++++++++++
i looked up this error on google and found the following:
http://peach.ease.lsoft.com/scripts/...-l&T=0&P=18593

..
Is your code running as a separate exe rather than an Outlook
add-in/extension?
There are quite a few bugs in MAPI when it comes to marshalling
IMAPISession
across the process boundaries - you will get back the RPC_E_FAULT error
when
you touch the profiles API (IProfAdmin etc) or call Imessage::CopyTo()
or
open the ACL table under Exchange.
Make sure that IMAPISession lives in your process address space so that
it
won't have to be marshalled - use MAPILogonEx() to retrieve
IMAPISession
instead of reading it from Namespace.MAPIOBJECT.
..
++++++++++++++
now, since i HAVE to use session.MAPIOBJECT = oNS.MAPIOBJECT (as only
that brings me back good results) is there a way to move these messages
to another folder? is there a way out?


again, thanks for you help.


--
mirzoni
------------------------------------------------------------------------
mirzoni's Profile: http://www.officehelp.in/member.php?userid=5392
View this thread: http://www.officehelp.in/showthread.php?t=1277781

Posted from - http://www.officehelp.in



 




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
Outlook Redemption problem: Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154. [email protected] Outlook - Using Forms 1 September 18th 06 10:44 AM
Outlook instability question for managed controls on OL homepages [email protected] Add-ins for Outlook 1 August 8th 06 03:14 PM
Useing Redemption Object to Read an Inbox Damian Add-ins for Outlook 9 June 8th 06 07:57 AM
Redemption - problem with Save Martin Outlook and VBA 4 January 31st 06 10:56 AM
Problem with Sent Items/Redemption קובץ Outlook and VBA 10 January 12th 06 04:26 PM


All times are GMT +1. The time now is 06:21 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.