|
|
|
date: Thu, 14 Feb 2008 11:49:03 -0800,
group: microsoft.public.exchange.development
back
Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?
Hello,
the thing is that XmlHttp is fine for transferring xml or plain text. But it
may be difficult to get the binary stream.
You can get the data of the attachment from the responseStream property of
the Xmltttprequest instance. You'll get an object which is of type IStream.
Now you need a stream to a file on the disk. I don't know if VBA can give
you this.
Kind regards,
Henning Krause
"Maury Markowitz" wrote in
message news:2BCE453A-34F6-4089-BBEB-9810C37DB387@microsoft.com...
> "Henning Krause [MVP - Exchange]" wrote:
>
>> you can download Cdo from the Microsoft website. See here for more infos
>> on
>> this: http://blogs.msdn.com/dgoldman/archive/2006/06/19/636996.aspx
>
> Well I'm just looking for the first thing that (a) works and (b) I can
> understand. DAV seems to be working so far. Here's what I have...
>
> uri = "http://myserver/public/myfolder/MyTest.eml/"
>
> ' Create the XMLHTTP object and use the URI, false=async
> Set req = CreateObject("microsoft.xmlhttp")
> req.Open "X-MS-ENUMATTS", uri, False
>
> ' send and receive it
> req.send
> Set resDoc = req.responseXML
>
> ' use the DOM to get the elements we need, the (0) means
> ' "first item in the array", which is fine if we assume only one
> attachment
> fname =
> resDoc.getElementsByTagName("e:attachmentfilename")(0).firstChild.Text
> uri = resDoc.getElementsByTagName("a:href")(0).firstChild.Text
>
> So far so good, I have both the original filename (useful) as well as the
> URI.
>
> So now I need to retreive the file and save it out to disk. Reading over a
> previous thread of yours (from 2006), this might be difficult in VBA?
>
> Maury
date: Thu, 14 Feb 2008 22:51:10 +0100
author: Henning Krause [MVP - Exchange]
|
|