Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP CDO
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2005, 04:40 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CDOMessage.Categories for Exch2k Event sink

Hi,

I am writing an exchange 2000 event sink in vbscript. What I need to do is assign a certain Outlook category to every incoming message. So I tried registering "onsave" eventsink and attaching a test script. It works, I can e.g. add some text to the body of each incoming message.

But for some reason I cannot access Categories property of the message object.
My code is this:

'------------------------------------------------------
<SCRIPT LANGUAGE="VBScript">

Sub ExStoreEvents_OnSave(pEventInfo, bstrURLItem, lFlags)

Const EVT_NEW_ITEM = 1
Const EVT_IS_DELIVERED = 8

If (lFlags And EVT_IS_DELIVERED) Or (lFlags And EVT_NEW_ITEM) Then

    On Error Resume Next
    Dim msgobj

    Set msgobj = CreateObject("CDO.Message")
    msgobj.DataSource.Open bstrURLItem, ,3

    arrCat = msgobj.Categories()
    msgobj.TextBody = "Err.Number" & ": " & err.Number & vbCrLf & _
        "Err.Description" & ": " & err.Description & vbCrLf

    msgobj.Fields.Update
    msgobj.DataSource.Save

    Set msgobj = Nothing

End If

End Sub

</SCRIPT>
'------------------------------------------------------

So when I try to send a message to that mailbox I get it with the following text in the body:

Err.Number: 438
Err.Description: Object doesn't support this property or method

So it looks like there is no such Categories property for CDO message object. But here they say that it exists
http://msdn.microsoft.com/library/de...ge_object_.asp

So what could I be doing wrong?

Thanx in advance,
Gatis






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort categories using checkbox melvados Visual Basic 2005 Basics 2 August 5th, 2008 08:45 PM
Sub Categories for Forum- tectrix BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 9 May 21st, 2008 05:25 PM
Unlimited categories golden_drifter Access 2 August 31st, 2006 07:21 AM
Deleting Categories spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 July 19th, 2006 03:07 AM
Need help : how to query multiple categories will2kready SQL Language 0 January 10th, 2006 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.