Nick_Whymark -> Appointment message class in public folder (16.Jun.2004 12:27:00 PM)
|
I am trying to strip out all of the attachments added to instances of a custom form published to a Public Folder. This is done via a timed Event Sink.
I open an ado recordset and run a query to find all those items that have attachments using the "urn:schemas:httpmail:hasattachment" property. I then iterate through the recordset, saving any attachments to a fileshare and then deleting all of the attachments in the item. After this is complete, I save the item.
The code runs successfully for custom forms based on a IPM.Contact, but when the code is executed for a form of base type IPM.Appointment the message class changes from the custom type to the base type. The code that is executing is shown below. Does anyone know how I can stop the Custom message class reverting to the standard message class on Appointment items !
code:
Dim cdoMsg As CDO.Message Dim objAttachment As CDO.IBodyPart While Not adoSet.EOF sMsgClass = adoSet.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass").Value Set cdoMsg = CreateObject("CDO.Message") cdoMsg.DataSource.Open adoSet.Fields("DAV:href").Value, , 3 For Each objAttachment In cdoMsg.Attachments 'Save it to a file share sLinkLocation = "c:\" & objAttachment.FileName objAttachment.SaveToFile sLinkLocation Next cdoMsg.Attachments.DeleteAll cdoMsg.DataSource.Save adoSet.MoveNext Wend
|
|
|
|