Dear friends,

We have developed a web application which allows our Company's Exchange 5.5
users
to manage(add/edit/delete)thier rules  for thier inbox (similar to outllok
rule wizard)from a
web interface. 

We are using "Rule.dll"  found in Exchange 5.5 Platform SDK to create the
rules from ASP pages
hosted on a IIS.

Code runs properly for some users but fails for some other users.

3 Steps to Reproduce the Behaviour

1>Set delivery to "Personal folders" through the services options in Tools
option of Outlook
  This create the "Inbox" folder in your Personal folder which becomes a
specialfolder & you can         never delete the folder even if u want.
Now if you want , you can reset the delivery back to "Mailbox" or keep it
pointing
to "personal folders" itslef..This wont affect the remaining steps behaviour
(Now for outlook 97 clients...u can directly run the code in step 3 to get
the desired error
 but for outlook 2000 ..u need to follow step 2 also)
2>Now using Outlook rule wizard ,create a client side rule for the inbox(e.g
move messages from inbox to some personal folder)& turn on the rule
3>Now run any of the following two sets of code
----------------------------------
 Set objInbox =  objCDOSession.Inbox
 set colRules = server.CreateObject("MSExchange.Rules") 
 colRules.Folder = objInbox 
-----------------------------------OR-----------
Set objInfoStore = objCDOSession.InfoStores (2)
Set objPrivateFs = objInfoStore.RootFolder.Folders

For Each objFolder in objPrivateFs
  If objFolder.Name = "Inbox" Then
    Set objInbox = objFolder
    Exit For
  End If
Next
 colRules.Folder = objInbox 
------------------------------------
For both the cases , U will see the following error at
"colrules.folder=objInbox"

-2147221241006~ASP 0177~Server.CreateObject 
 Failed~The operation completed successfully   
which corresponds to MAPI_E_INVALID_ENTRYID

4>Turn off the outlook  client side rule created in step 2 ...the code works
fine..
  Turn on the outlook rule again..u will get the same error.
  Remove the personal folders..u still get the same error.
  Set delivery to back to "Mailbox" or "personal folders"..u still get the
error..

Observations :
1>I am very sure that the Inbox folder being passed from my code is the
correct
  folder for which i want to set up rules thru my code.
2>It looks like that code inside the RULE.DLL is fetching entry id  for
inbox for wrong default store  & failing when it finds two "Inbox" entry ids
(one for Mailbox & another for Personal folder in trooubled profiles )in the
Exchange Server...

We tried to debug into Rule.dll sourcecode(available in platsdk) in VC++
-----------------------------------------------------------
Created a pointer to the IRules interface.

I have used the function PutFolder(IDispatch *pVal) in Rules.dll for
assigning the folder,the  function internally calls
put_Folder(LPDISPATCH newVal) of the CRules class.

The function load(LPSRowSet lpRowSet) of the CRules class inside
put_Folder(LPDISPATCH newVal) is  returning 80040107
(MAPI_E_INVALID_ENTRYID).

Further I went inside the load(LPSRowSet lpRowSet) function wherein
its calling a function  load(LPSRow lpSRow,ULONG ulIndex) of CRule
class.
This function calls the funtion load(LPACTIONS lpActions) of class
CActions which calls funtion  load(LPACTION lpAction) of class
CAction.

When the ulIndex is 3 i.e third time.. 
the
MethodInvoke(_Module.m_pCDOSession,_T("GetFolder"),&varResult,&dispParams,DI
SPATCH_PROPERTYGET)
 function is returning 80040107 (MAPI_E_INVALID_ENTRYID).
This is happening for some users while others are getting return value
of 0 (SUCCESS).

-----------------------------------------------------------

Expecting some workaround fromu guys...

Cheers,
Nans


_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

Reply via email to