Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Thu, 14 Feb 2008 11:49:03 -0800,    group: microsoft.public.exchange.development        back       


Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
I have created a public folder to act as a "drop box" for incoming messages 
that need to be readable by anyone in the company. Some of these messages are 
automated reports that are generated by 3rd parties. I'd like to access these 
files, preferably via ODBC.

I have linked to the appropriate folder, and I see that my test message has 
a boolean set for "Has Attachments". However I don't see any obvious way to 
get at the attachments. Is there a way to do this?

Maury
date: Thu, 14 Feb 2008 11:49:03 -0800   author:   Maury Markowitz

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
Hello,

perhaps this will help you: 
http://gsexdev.blogspot.com/2005/08/mailbox-attachment-auditing-script.html

Kind regards,
Henning Krause

"Maury Markowitz"  wrote in 
message news:2327BF0C-B3E9-4918-A67F-3B4CECA85DBF@microsoft.com...
>I have created a public folder to act as a "drop box" for incoming messages
> that need to be readable by anyone in the company. Some of these messages 
> are
> automated reports that are generated by 3rd parties. I'd like to access 
> these
> files, preferably via ODBC.
>
> I have linked to the appropriate folder, and I see that my test message 
> has
> a boolean set for "Has Attachments". However I don't see any obvious way 
> to
> get at the attachments. Is there a way to do this?
>
> Maury
date: Thu, 14 Feb 2008 21:32:52 +0100   author:   Henning Krause [MVP - Exchange]

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
"Henning Krause [MVP - Exchange]" wrote:

> perhaps this will help you: 
> http://gsexdev.blogspot.com/2005/08/mailbox-attachment-auditing-script.html

Well unfortunately I know nothing about DataShape so I can't really make 
heads or tails of it.

I'm currently looking over the CDO interface, which seems to work the same 
way my brain does. But even though I Referenced it in my VBA (Access) 
project, every attempt to refer to objects inside fails. For instance...

Dim Fldr As CDO.Folder

Complains about the user-defined-type not existing.

I also tried the WebDAV approach, as outlined in a message you posted some 
time ago (2006), but the problem is that it appears the resulting attachments 
will not easily be saved (Access VBA with no .net).

Maury
date: Thu, 14 Feb 2008 13:04:00 -0800   author:   Maury Markowitz

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
Hello,

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

Kind regards,
Henning Krause

"Maury Markowitz"  wrote in 
message news:D52409BF-463A-4B1D-A7B2-B61FFD677476@microsoft.com...
> "Henning Krause [MVP - Exchange]" wrote:
>
>> perhaps this will help you:
>> http://gsexdev.blogspot.com/2005/08/mailbox-attachment-auditing-script.html
>
> Well unfortunately I know nothing about DataShape so I can't really make
> heads or tails of it.
>
> I'm currently looking over the CDO interface, which seems to work the same
> way my brain does. But even though I Referenced it in my VBA (Access)
> project, every attempt to refer to objects inside fails. For instance...
>
> Dim Fldr As CDO.Folder
>
> Complains about the user-defined-type not existing.
>
> I also tried the WebDAV approach, as outlined in a message you posted some
> time ago (2006), but the problem is that it appears the resulting 
> attachments
> will not easily be saved (Access VBA with no .net).
>
> Maury
date: Thu, 14 Feb 2008 22:10:14 +0100   author:   Henning Krause [MVP - Exchange]

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
"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 13:29:01 -0800   author:   Maury Markowitz

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]

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
"Henning Krause [MVP - Exchange]" wrote:

Perhaps I am overthinking this? Is there some easy way to do this that 
everyone uses? Surely scraping files from a folder is a common need?

Maury
date: Thu, 14 Feb 2008 14:01:03 -0800   author:   Maury Markowitz

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
Hi,

most people don't use VBScript or VBA to do this kind of stuff... :-)

Kind regards,
Henning

"Maury Markowitz"  wrote in 
message news:74CFC755-90AC-4EB3-9F36-6741858A3290@microsoft.com...
> "Henning Krause [MVP - Exchange]" wrote:
>
> Perhaps I am overthinking this? Is there some easy way to do this that
> everyone uses? Surely scraping files from a folder is a common need?
>
> Maury
date: Fri, 15 Feb 2008 21:12:45 +0100   author:   Henning Krause [MVP - Exchange]

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
"Henning Krause [MVP - Exchange]" wrote:
> most people don't use VBScript or VBA to do this kind of stuff... :-)

Well, what would be the normal solution?

Maury
date: Tue, 19 Feb 2008 07:13:05 -0800   author:   Maury Markowitz

Re: Accessing attachments through ODBC? Any ODBC/Exchange gurus?   
Hi,

if you use a language like Visual Basic or C++ or C# you can easily work 
with binary data.

Perhaps there are ActiveX controls available which you can use to deal with 
the data from VBA.

Kind regards,
Henning Krause

"Maury Markowitz"  wrote in 
message news:B0DA06D3-5FAD-4666-86E5-D933AD7EFBCE@microsoft.com...
> "Henning Krause [MVP - Exchange]" wrote:
>> most people don't use VBScript or VBA to do this kind of stuff... :-)
>
> Well, what would be the normal solution?
>
> Maury
date: Sun, 24 Feb 2008 21:36:04 +0100   author:   Henning Krause [MVP - Exchange]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us