|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Send a message with MAPI properties via CDOEX not workingproperties. After sending the message via CDOEX, the properties are gone and the MessageClass is always IPM.Note. Here is my code: set objTaskRequest = CreateObject("CDO.CalendarMessage") objTaskRequest.Fields("DAV:contentclass") = "urn:content-classes:taskrequest" objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") = "IPM.TaskRequest" objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" & PR_MESSAGE_CLASS) = "TaskRequest" objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") = 1 objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") = strTaskEntryID objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") = 1 objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") = 1 objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") = 1 thx, mike When your sending i think you will need to ensure that you are sending using
Exchange (using the Exchange Mail Submission Uniform Resource Identifier) or the properties wont persist eg set rec = createobject("ADODB.Record") Set Msg = CreateObject("CDO.Message") Set Config = CreateObject("CDO.Configuration") rec.open "file://./backofficestorage/youdomain/MBX/mailbox",,3 Set Msg.Configuration = Config Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3 'cdoSendUsingExchange Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") = "file://./backofficestorage/youdomain/MBX/mailbox" Config("http://schemas.microsoft.com/cdo/configuration/activeconnection") = rec.activeconnection Config.Fields.Update Msg.To = b***@yourdomain.com Msg.From = mail***@yourdomain.com Msg.Subject = "test" Msg.Fields("DAV:contentclass") ="urn:content-classes:taskrequest" Msg.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass")= "IPM.TaskRequest" Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a")= 1 Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519")= strTaskEntryID Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514")= 1 Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518")= 1 Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01")= 1 msg.fields.update Msg.Send Cheers Glen Show quote "mike" <m.schw***@ondot.at> wrote in message news:667f9a0c.0504040859.1a5137a1@posting.google.com... >I cretae a new Message object (CDO.Message) and set several MAPI > properties. > After sending the message via CDOEX, the properties are gone and the > MessageClass is always IPM.Note. > > Here is my code: > > set objTaskRequest = CreateObject("CDO.CalendarMessage") > > objTaskRequest.Fields("DAV:contentclass") = > "urn:content-classes:taskrequest" > objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") > = "IPM.TaskRequest" > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" & > PR_MESSAGE_CLASS) = "TaskRequest" > > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") > = 1 > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") > = strTaskEntryID > objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") > = 1 > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") > = 1 > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") > = 1 > > > thx, mike Hi!
That was it, now it works fine. Many thanx for your help. br, Michael Show quote "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message news:<urxE#hXOFHA.3380@TK2MSFTNGP15.phx.gbl>... > When your sending i think you will need to ensure that you are sending using > Exchange (using the Exchange Mail Submission Uniform Resource Identifier) or > the properties wont persist eg > > set rec = createobject("ADODB.Record") > Set Msg = CreateObject("CDO.Message") > Set Config = CreateObject("CDO.Configuration") > rec.open "file://./backofficestorage/youdomain/MBX/mailbox",,3 > Set Msg.Configuration = Config > Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3 > 'cdoSendUsingExchange > Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") = > "file://./backofficestorage/youdomain/MBX/mailbox" > Config("http://schemas.microsoft.com/cdo/configuration/activeconnection") = > rec.activeconnection > Config.Fields.Update > Msg.To = b***@yourdomain.com > Msg.From = mail***@yourdomain.com > Msg.Subject = "test" > Msg.Fields("DAV:contentclass") ="urn:content-classes:taskrequest" > Msg.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass")= > "IPM.TaskRequest" > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a")= > 1 > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519")= > strTaskEntryID > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514")= > 1 > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518")= > 1 > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01")= > 1 > msg.fields.update > Msg.Send > > Cheers > Glen > > > "mike" <m.schw***@ondot.at> wrote in message > news:667f9a0c.0504040859.1a5137a1@posting.google.com... > >I cretae a new Message object (CDO.Message) and set several MAPI > > properties. > > After sending the message via CDOEX, the properties are gone and the > > MessageClass is always IPM.Note. > > > > Here is my code: > > > > set objTaskRequest = CreateObject("CDO.CalendarMessage") > > > > objTaskRequest.Fields("DAV:contentclass") = > > "urn:content-classes:taskrequest" > > objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") > > = "IPM.TaskRequest" > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" & > > PR_MESSAGE_CLASS) = "TaskRequest" > > > > > > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") > > = 1 > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") > > = strTaskEntryID > > objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") > > = 1 > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") > > = 1 > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") > > = 1 > > > > > > thx, mike Similar problem when trying to attach an existing object (IPM.Task).
All custom MAPI properties on the attached message are gone and the MessageClass is again IPM.Note. ' get a reference to a task in a public folder ' strTaskUrl = "http://mailserver/public/projects/xyz.EML" set objTask = CreateObject("CDO.Message") set objConn = CreateObject("ADODB.Connection") objConn.ConnectionString = strTaskUrl objConn.Provider = "ExOledb.Datasource" objConn.Open objTask.DataSource.Open strTaskUrl, objConn ' attach the task to another message ' Set iBp = objTaskRequest.BodyPart.AddBodyPart(-1) iBP.ContentClass = "urn:content-classes:task" Set iDsrc = objTask.DataSource iDsrc.SaveToObject iBp, "IBodyPart" Many thy for any help, Michael Show quote m.schw***@ondot.at (mike) wrote in message news:<667f9a0c.0504060713.75398710@posting.google.com>... > Hi! > > That was it, now it works fine. > > Many thanx for your help. > > br, Michael > > "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message news:<urxE#hXOFHA.3380@TK2MSFTNGP15.phx.gbl>... > > When your sending i think you will need to ensure that you are sending using > > Exchange (using the Exchange Mail Submission Uniform Resource Identifier) or > > the properties wont persist eg > > > > set rec = createobject("ADODB.Record") > > Set Msg = CreateObject("CDO.Message") > > Set Config = CreateObject("CDO.Configuration") > > rec.open "file://./backofficestorage/youdomain/MBX/mailbox",,3 > > Set Msg.Configuration = Config > > Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3 > > 'cdoSendUsingExchange > > Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") = > > "file://./backofficestorage/youdomain/MBX/mailbox" > > Config("http://schemas.microsoft.com/cdo/configuration/activeconnection") = > > rec.activeconnection > > Config.Fields.Update > > Msg.To = b***@yourdomain.com > > Msg.From = mail***@yourdomain.com > > Msg.Subject = "test" > > Msg.Fields("DAV:contentclass") ="urn:content-classes:taskrequest" > > Msg.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass")= > > "IPM.TaskRequest" > > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a")= > > 1 > > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519")= > > strTaskEntryID > > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514")= > > 1 > > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518")= > > 1 > > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01")= > > 1 > > msg.fields.update > > Msg.Send > > > > Cheers > > Glen > > > > > > "mike" <m.schw***@ondot.at> wrote in message > > news:667f9a0c.0504040859.1a5137a1@posting.google.com... > > >I cretae a new Message object (CDO.Message) and set several MAPI > > > properties. > > > After sending the message via CDOEX, the properties are gone and the > > > MessageClass is always IPM.Note. > > > > > > Here is my code: > > > > > > set objTaskRequest = CreateObject("CDO.CalendarMessage") > > > > > > objTaskRequest.Fields("DAV:contentclass") = > > > "urn:content-classes:taskrequest" > > > objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") > > > = "IPM.TaskRequest" > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" & > > > PR_MESSAGE_CLASS) = "TaskRequest" > > > > > > > > > > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") > > > = 1 > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") > > > = strTaskEntryID > > > objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") > > > = 1 > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") > > > = 1 > > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") > > > = 1 > > > > > > > > > thx, mike That's not really going to work in CDOEX. With CDOEX you more dealing with
the RFC 822 stream of the message which is ex any mapi attributes. Exchange uses TNEF to transport this kind of stuff around so submitting a message with mapi properties to the Exchange Mail Submission Uniform Resource Identifier will keep those properties intact by encoding them into a TNEF stream for you. But trying to add an attachment via one of the CDOEX interfaces isn't going to work because CDOEX doesn't provide and facility to maintain those mapi properties. What might work is if you use the ibodypart Interface and manually add each of the mapi properties to that particular body part (im not sure though you'll have to test this yourself). Otherwise you may need to look at using MAPI via either exMapi or the Outlook object model. Cheers Glen Show quote "mike" <m.schw***@ondot.at> wrote in message news:667f9a0c.0504070327.2dcc59eb@posting.google.com... > Similar problem when trying to attach an existing object (IPM.Task). > All custom MAPI properties on the attached message are gone and the > MessageClass is again IPM.Note. > > > ' get a reference to a task in a public folder > ' > strTaskUrl = "http://mailserver/public/projects/xyz.EML" > > set objTask = CreateObject("CDO.Message") > > set objConn = CreateObject("ADODB.Connection") > objConn.ConnectionString = strTaskUrl > objConn.Provider = "ExOledb.Datasource" > objConn.Open > > objTask.DataSource.Open strTaskUrl, objConn > > > ' attach the task to another message > ' > Set iBp = objTaskRequest.BodyPart.AddBodyPart(-1) > iBP.ContentClass = "urn:content-classes:task" > > Set iDsrc = objTask.DataSource > > iDsrc.SaveToObject iBp, "IBodyPart" > > > > Many thy for any help, > > Michael > > > > m.schw***@ondot.at (mike) wrote in message > news:<667f9a0c.0504060713.75398710@posting.google.com>... >> Hi! >> >> That was it, now it works fine. >> >> Many thanx for your help. >> >> br, Michael >> >> "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message >> news:<urxE#hXOFHA.3380@TK2MSFTNGP15.phx.gbl>... >> > When your sending i think you will need to ensure that you are sending >> > using >> > Exchange (using the Exchange Mail Submission Uniform Resource >> > Identifier) or >> > the properties wont persist eg >> > >> > set rec = createobject("ADODB.Record") >> > Set Msg = CreateObject("CDO.Message") >> > Set Config = CreateObject("CDO.Configuration") >> > rec.open "file://./backofficestorage/youdomain/MBX/mailbox",,3 >> > Set Msg.Configuration = Config >> > Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3 >> > 'cdoSendUsingExchange >> > Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") = >> > "file://./backofficestorage/youdomain/MBX/mailbox" >> > Config("http://schemas.microsoft.com/cdo/configuration/activeconnection") >> > = >> > rec.activeconnection >> > Config.Fields.Update >> > Msg.To = b***@yourdomain.com >> > Msg.From = mail***@yourdomain.com >> > Msg.Subject = "test" >> > Msg.Fields("DAV:contentclass") ="urn:content-classes:taskrequest" >> > Msg.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass")= >> > "IPM.TaskRequest" >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a")= >> > 1 >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519")= >> > strTaskEntryID >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514")= >> > 1 >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518")= >> > 1 >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01")= >> > 1 >> > msg.fields.update >> > Msg.Send >> > >> > Cheers >> > Glen >> > >> > >> > "mike" <m.schw***@ondot.at> wrote in message >> > news:667f9a0c.0504040859.1a5137a1@posting.google.com... >> > >I cretae a new Message object (CDO.Message) and set several MAPI >> > > properties. >> > > After sending the message via CDOEX, the properties are gone and the >> > > MessageClass is always IPM.Note. >> > > >> > > Here is my code: >> > > >> > > set objTaskRequest = CreateObject("CDO.CalendarMessage") >> > > >> > > objTaskRequest.Fields("DAV:contentclass") = >> > > "urn:content-classes:taskrequest" >> > > objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") >> > > = "IPM.TaskRequest" >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" & >> > > PR_MESSAGE_CLASS) = "TaskRequest" >> > > >> > > >> > > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") >> > > = 1 >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") >> > > = strTaskEntryID >> > > objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") >> > > = 1 >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") >> > > = 1 >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") >> > > = 1 >> > > >> > > >> > > thx, mike Hi Glen!
I tried to set the properties on the Bodypart, but it did not work. Is it possible to create a TNEF stream from Visual Basic? thx, Michael Show quote "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message news:<eih5HW$OFHA.2252@TK2MSFTNGP15.phx.gbl>... > That's not really going to work in CDOEX. With CDOEX you more dealing with > the RFC 822 stream of the message which is ex any mapi attributes. Exchange > uses TNEF to transport this kind of stuff around so submitting a message > with mapi properties to the Exchange Mail Submission Uniform Resource > Identifier will keep those properties intact by encoding them into a TNEF > stream for you. But trying to add an attachment via one of the CDOEX > interfaces isn't going to work because CDOEX doesn't provide and facility to > maintain those mapi properties. What might work is if you use the ibodypart > Interface and manually add each of the mapi properties to that particular > body part (im not sure though you'll have to test this yourself). Otherwise > you may need to look at using MAPI via either exMapi or the Outlook object > model. > > Cheers > Glen > > "mike" <m.schw***@ondot.at> wrote in message > news:667f9a0c.0504070327.2dcc59eb@posting.google.com... > > Similar problem when trying to attach an existing object (IPM.Task). > > All custom MAPI properties on the attached message are gone and the > > MessageClass is again IPM.Note. > > > > > > ' get a reference to a task in a public folder > > ' > > strTaskUrl = "http://mailserver/public/projects/xyz.EML" > > > > set objTask = CreateObject("CDO.Message") > > > > set objConn = CreateObject("ADODB.Connection") > > objConn.ConnectionString = strTaskUrl > > objConn.Provider = "ExOledb.Datasource" > > objConn.Open > > > > objTask.DataSource.Open strTaskUrl, objConn > > > > > > ' attach the task to another message > > ' > > Set iBp = objTaskRequest.BodyPart.AddBodyPart(-1) > > iBP.ContentClass = "urn:content-classes:task" > > > > Set iDsrc = objTask.DataSource > > > > iDsrc.SaveToObject iBp, "IBodyPart" > > > > > > > > Many thy for any help, > > > > Michael > > > > > > > > m.schw***@ondot.at (mike) wrote in message > > news:<667f9a0c.0504060713.75398710@posting.google.com>... > >> Hi! > >> > >> That was it, now it works fine. > >> > >> Many thanx for your help. > >> > >> br, Michael > >> > >> "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message > >> news:<urxE#hXOFHA.3380@TK2MSFTNGP15.phx.gbl>... > >> > When your sending i think you will need to ensure that you are sending > >> > using > >> > Exchange (using the Exchange Mail Submission Uniform Resource > >> > Identifier) or > >> > the properties wont persist eg > >> > > >> > set rec = createobject("ADODB.Record") > >> > Set Msg = CreateObject("CDO.Message") > >> > Set Config = CreateObject("CDO.Configuration") > >> > rec.open "file://./backofficestorage/youdomain/MBX/mailbox",,3 > >> > Set Msg.Configuration = Config > >> > Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3 > >> > 'cdoSendUsingExchange > >> > Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") = > >> > "file://./backofficestorage/youdomain/MBX/mailbox" > >> > Config("http://schemas.microsoft.com/cdo/configuration/activeconnection") > >> > = > >> > rec.activeconnection > >> > Config.Fields.Update > >> > Msg.To = b***@yourdomain.com > >> > Msg.From = mail***@yourdomain.com > >> > Msg.Subject = "test" > >> > Msg.Fields("DAV:contentclass") ="urn:content-classes:taskrequest" > >> > Msg.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass")= > >> > "IPM.TaskRequest" > >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a")= > >> > 1 > >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519")= > >> > strTaskEntryID > >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514")= > >> > 1 > >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518")= > >> > 1 > >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01")= > >> > 1 > >> > msg.fields.update > >> > Msg.Send > >> > > >> > Cheers > >> > Glen > >> > > >> > > >> > "mike" <m.schw***@ondot.at> wrote in message > >> > news:667f9a0c.0504040859.1a5137a1@posting.google.com... > >> > >I cretae a new Message object (CDO.Message) and set several MAPI > >> > > properties. > >> > > After sending the message via CDOEX, the properties are gone and the > >> > > MessageClass is always IPM.Note. > >> > > > >> > > Here is my code: > >> > > > >> > > set objTaskRequest = CreateObject("CDO.CalendarMessage") > >> > > > >> > > objTaskRequest.Fields("DAV:contentclass") = > >> > > "urn:content-classes:taskrequest" > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") > >> > > = "IPM.TaskRequest" > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" & > >> > > PR_MESSAGE_CLASS) = "TaskRequest" > >> > > > >> > > > >> > > > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") > >> > > = 1 > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") > >> > > = strTaskEntryID > >> > > objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") > >> > > = 1 > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") > >> > > = 1 > >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") > >> > > = 1 > >> > > > >> > > > >> > > thx, mike One way that should work okay in VB is to use CDO 1.2 (which uses MAPI) and
attach the task as CdoEmbeddedMessage eg something like this works okay for me. public const CdoEmbeddedMessage = 4 set objSession = CreateObject("MAPI.Session") Const CdoPR_FLAG_STATUS = &H8031001E strProfile = "servername" & vbLf & "mailbox" objSession.Logon "",,, False,, True, strProfile Set objInbox = objSession.Inbox Set objInfoStore = objSession.GetInfoStore(objSession.Inbox.StoreID) Set objpubstore = objSession.InfoStores("Public Folders") taskentryid = "000000001A447390AA6611CD9BC800AA002FC45A0900E6AC7B7EC30A514A9F5158CDDC88F9B00000000491B70000E6AC7B7EC30A514A9F5158CDDC88F9B0000000049D680000" set objtask = objSession.getmessage(taskentryid,objpubStore.id) wscript.echo objtask.subject Set objmessage = objSession.Outbox.Messages.Add objmessage.Subject = "mail subject" objmessage.Text = "Content of the mail" Set objRecipient = objmessage.Recipients.Add objRecipient.Name = "administra***@managenet.com.au" Set objAttachment = objMessage.Attachments.Add objAttachment.Position = 0 objAttachment.Type = CdoEmbeddedMessage objAttachment.Source = objtask.id objRecipient.Resolve objmessage.Update objmessage.Send Cheers Glen Show quote "mike" <m.schw***@ondot.at> wrote in message news:667f9a0c.0504110843.767ba69b@posting.google.com... > Hi Glen! > > I tried to set the properties on the Bodypart, but it did not work. > Is it possible to create a TNEF stream from Visual Basic? > > thx, Michael > > "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message > news:<eih5HW$OFHA.2252@TK2MSFTNGP15.phx.gbl>... >> That's not really going to work in CDOEX. With CDOEX you more dealing >> with >> the RFC 822 stream of the message which is ex any mapi attributes. >> Exchange >> uses TNEF to transport this kind of stuff around so submitting a message >> with mapi properties to the Exchange Mail Submission Uniform Resource >> Identifier will keep those properties intact by encoding them into a TNEF >> stream for you. But trying to add an attachment via one of the CDOEX >> interfaces isn't going to work because CDOEX doesn't provide and facility >> to >> maintain those mapi properties. What might work is if you use the >> ibodypart >> Interface and manually add each of the mapi properties to that particular >> body part (im not sure though you'll have to test this yourself). >> Otherwise >> you may need to look at using MAPI via either exMapi or the Outlook >> object >> model. >> >> Cheers >> Glen >> >> "mike" <m.schw***@ondot.at> wrote in message >> news:667f9a0c.0504070327.2dcc59eb@posting.google.com... >> > Similar problem when trying to attach an existing object (IPM.Task). >> > All custom MAPI properties on the attached message are gone and the >> > MessageClass is again IPM.Note. >> > >> > >> > ' get a reference to a task in a public folder >> > ' >> > strTaskUrl = "http://mailserver/public/projects/xyz.EML" >> > >> > set objTask = CreateObject("CDO.Message") >> > >> > set objConn = CreateObject("ADODB.Connection") >> > objConn.ConnectionString = strTaskUrl >> > objConn.Provider = "ExOledb.Datasource" >> > objConn.Open >> > >> > objTask.DataSource.Open strTaskUrl, objConn >> > >> > >> > ' attach the task to another message >> > ' >> > Set iBp = objTaskRequest.BodyPart.AddBodyPart(-1) >> > iBP.ContentClass = "urn:content-classes:task" >> > >> > Set iDsrc = objTask.DataSource >> > >> > iDsrc.SaveToObject iBp, "IBodyPart" >> > >> > >> > >> > Many thy for any help, >> > >> > Michael >> > >> > >> > >> > m.schw***@ondot.at (mike) wrote in message >> > news:<667f9a0c.0504060713.75398710@posting.google.com>... >> >> Hi! >> >> >> >> That was it, now it works fine. >> >> >> >> Many thanx for your help. >> >> >> >> br, Michael >> >> >> >> "Glen Scales [MVP]" <gsca***@outlookexchange.com> wrote in message >> >> news:<urxE#hXOFHA.3380@TK2MSFTNGP15.phx.gbl>... >> >> > When your sending i think you will need to ensure that you are >> >> > sending >> >> > using >> >> > Exchange (using the Exchange Mail Submission Uniform Resource >> >> > Identifier) or >> >> > the properties wont persist eg >> >> > >> >> > set rec = createobject("ADODB.Record") >> >> > Set Msg = CreateObject("CDO.Message") >> >> > Set Config = CreateObject("CDO.Configuration") >> >> > rec.open "file://./backofficestorage/youdomain/MBX/mailbox",,3 >> >> > Set Msg.Configuration = Config >> >> > Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = >> >> > 3 >> >> > 'cdoSendUsingExchange >> >> > Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") >> >> > = >> >> > "file://./backofficestorage/youdomain/MBX/mailbox" >> >> > Config("http://schemas.microsoft.com/cdo/configuration/activeconnection") >> >> > = >> >> > rec.activeconnection >> >> > Config.Fields.Update >> >> > Msg.To = b***@yourdomain.com >> >> > Msg.From = mail***@yourdomain.com >> >> > Msg.Subject = "test" >> >> > Msg.Fields("DAV:contentclass") ="urn:content-classes:taskrequest" >> >> > Msg.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass")= >> >> > "IPM.TaskRequest" >> >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a")= >> >> > 1 >> >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519")= >> >> > strTaskEntryID >> >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514")= >> >> > 1 >> >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518")= >> >> > 1 >> >> > Msg.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01")= >> >> > 1 >> >> > msg.fields.update >> >> > Msg.Send >> >> > >> >> > Cheers >> >> > Glen >> >> > >> >> > >> >> > "mike" <m.schw***@ondot.at> wrote in message >> >> > news:667f9a0c.0504040859.1a5137a1@posting.google.com... >> >> > >I cretae a new Message object (CDO.Message) and set several MAPI >> >> > > properties. >> >> > > After sending the message via CDOEX, the properties are gone and >> >> > > the >> >> > > MessageClass is always IPM.Note. >> >> > > >> >> > > Here is my code: >> >> > > >> >> > > set objTaskRequest = CreateObject("CDO.CalendarMessage") >> >> > > >> >> > > objTaskRequest.Fields("DAV:contentclass") = >> >> > > "urn:content-classes:taskrequest" >> >> > > objTaskRequest.Fields("http://schemas.microsoft.com/exchange/outlookmessageclass") >> >> > > = "IPM.TaskRequest" >> >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/proptag/" >> >> > > & >> >> > > PR_MESSAGE_CLASS) = "TaskRequest" >> >> > > >> >> > > >> >> > > >> >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x851a") >> >> > > = 1 >> >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8519") >> >> > > = strTaskEntryID >> >> > > objTaskRequest..Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8514") >> >> > > = 1 >> >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8518") >> >> > > = 1 >> >> > > objTaskRequest.Fields("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x7D01") >> >> > > = 1 >> >> > > >> >> > > >> >> > > thx, mike |
|||||||||||||||||||||||