Hi Li,
I noticed that an MVP Glen Scales has replied to you in anothor thread in
icrosoft.public.exchange2000.development. For convenience, I paste his
reply here. If you are still having questions, please reply to the post,
and I will find more resources for you. Thanks!
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
You should be able to use the CN which should be there wether its a normal
attachment or an embedded message. You might also want to look at using the
PR_ATTACH_METHOD (
http://schemas.microsoft.com/mapi/proptag/x37050003) this
will tell you what type of attachment you are dealing with eg for a normal
attachment this should return 1 or for a embedded message it should return
5. If you want to access an attachment that is within the embedded message
then you need to call X-MS-ENUMATTS against the URL of the embedded
message.
Eg Something like this
strURI = "
http://servername/Exchange/mailbox/Inbox/item.EML"
set req = createobject("microsoft.xmlhttp")
req.open "X-MS-ENUMATTS", strURI, false, "", ""
req.send
If req.status > 207 Or req.status < 207 Then
wscript.echo "Status: " & req.status
wscript.echo "Status text: " & req.statustext
wscript.echo "Response text: " & req.responsetext
Else
set resDoc = req.responseXML
Set objPropstatNodeList = resDoc.getElementsByTagName("a
ropstat")
Set objHrefNodeList = resDoc.getElementsByTagName("a:href")
If objPropstatNodeList.length > 0 Then
wscript.echo objPropstatNodeList.length & " attachments found..."
For i = 0 To (objPropstatNodeList.length -1)
set objPropstatNode = objPropstatNodeList.nextNode
set objHrefNode = objHrefNodeList.nextNode
wscript.echo ""
wscript.echo "Attachment: " & objHrefNode.Text
set objNode =
objPropstatNode.selectSingleNode("a
rop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode.selectSingleNode("a
rop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(objHrefNode.Text)
else
set objNode1 =
objPropstatNode.selectSingleNode("a
rop/d:x3704001f")
wscript.echo "Attachment name: " & objNode1.Text
end if
next
Else
wscript.echo "No file attachments found..."
End If
End If
Set req = Nothing
sub embedattach(objhref)
req.open "X-MS-ENUMATTS", objhref, false, "", ""
req.send
If req.status > 207 Or req.status < 207 Then
wscript.echo "Status: " & req.status
wscript.echo "Status text: " & req.statustext
wscript.echo "Response text: " & req.responsetext
Else
wscript.echo ""
wscript.echo "Embedded Message"
set resDoc1 = req.responseXML
Set objPropstatNodeList1 = resDoc1.getElementsByTagName("a
ropstat")
Set objHrefNodeList1 = resDoc1.getElementsByTagName("a:href")
If objPropstatNodeList1.length > 0 Then
wscript.echo objPropstatNodeList1.length & " attachments found..."
For i = 0 To (objPropstatNodeList1.length -1)
set objPropstatNode1 = objPropstatNodeList1.nextNode
set objHrefNode1 = objHrefNodeList1.nextNode
wscript.echo "Attachment: " & objHrefNode1.Text
set objNode =
objPropstatNode1.selectSingleNode("a
rop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode1.selectSingleNode("a
rop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(objHrefNode1.Text)
else
set objNode1 =
objPropstatNode1.selectSingleNode("a
rop/d:x3704001f")
wscript.echo "Attachment name: " & objNode1.Text
end if
next
Else
wscript.echo "No file attachments found..."
End If
End If
end sub
Cheers
Glen