Need to change http://schemas.microsoft.com/exchange/outlook
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Need to change http://schemas.microsoft.com/exchange/outlook

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Joachim Brandt
Guest





Posted: Thu Nov 24, 2005 1:38 am    Post subject: Need to change http://schemas.microsoft.com/exchange/outlook Reply with quote

Hi,

after working 2 days on that issue, now hope this helps !

I hava an event sink registration through com+ on Ex 2003.
The event gets asynchonous fired when an new item is saved (OnSave).

The problem is the VB Code !!
I can read Items and write Item Properties to a debug file, but there seems
to be no way to change the outlookmessageclass item from IPM.Post to
IPM.Note or to make any other changes - maybe a Rights Problem, but the
Identity of the COM+ Application is Domain Admin and has Full Control over
the SERVER Object in Exchange System Manager + a Mailbox with Owner rights
to the Public Folder.


here's my coding after stripping all debug lines. It was basically created
with the Event Sink wizard Addin for VB6.
(Maybe something with the string parsing is still wrong - that's a minor
Problem)
______________________________________________________________________________________________________

Private Sub IExStoreAsyncEvents_OnSave(ByVal pEventInfo As
IExStoreEventInfo, ByVal bstrURLItem As String, ByVal lFlags As Long)

'This event is called after all the OnSyncSave events have been fired on
the Item.
'The exchange store thread is not blocked while this event is being
processed.

On Error GoTo Errorhandler

'Write to the log file that this event has been called.
Call EventLog("OnASyncSave", bstrURLItem, lFlags)

'/////////////////////////////////
'//// Insert Code Here ////
'/////////////////////////////////
Dim Rec As New ADODB.Record
Dim Conn As New ADODB.Connection
Dim Flds As ADODB.Fields
Dim Fld As ADODB.Field
Dim olmsgclass As String

Const MESSAGE_CLASS = "IPM.Note"

Conn.Provider = "ExOLEDB.DataSource"
Conn.Open bstrURLItem

Rec.Open bstrURLItem, Conn, adModeReadWrite, adCreateNonCollection Or
adCreateOverwrite
Set Flds = Rec.Fields
olmsgclass =
Flds.Item("http://schemas.microsoft.com/exchange/outlookmessageclass").Value

If StrComp(MESSAGE_CLASS, Left(olmsgclass, 8)) Then
'its not an IPM.Note
If Not StrComp("IPM.", Left(olmsgclass, 4)) Then
'its an IPM.xxxxxxxx
If InStr(5, olmsgclass, ".") Then
'its an IPM.xxxxx.xxxxxxxxxx
olmsgclass = MESSAGE_CLASS & Right(olmsgclass,
Len(olmsgclass) - InStr(5, olmsgclass, "."))
Else
'its an IPM.xxxx
olmsgclass = MESSAGE_CLASS
End If
' Change MAPI message class
Flds.Item("http://schemas.microsoft.com/exchange/outlookmessageclass").Value
= olmsgclass
' Save changes
Flds.Update
End If
End If
Conn.Close
Rec.Close
Set Conn = Nothing
Set Rec = Nothing


Exit Sub
Errorhandler:
Call ErrorLog("OnSave", Err.Number & vbTab & Err.Description,
bstrURLItem, lFlags)
End Sub

Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
New Topics Powered by phpBB