exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing attachments through ODBC? Any ODBC/Exchange gurus?

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Development
Author Message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 4:49 pm    Post subject: Accessing attachments through ODBC? Any ODBC/Exchange gurus? Reply with quote

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

Archived from group: microsoft>public>exchange>development
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Fri Feb 15, 2008 2:32 am    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

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 @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
Back to top
View user's profile Send private message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 6:04 pm    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

"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
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Fri Feb 15, 2008 3:10 am    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

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 @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
Back to top
View user's profile Send private message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 6:29 pm    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

"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
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Fri Feb 15, 2008 3:51 am    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

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 @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
Back to top
View user's profile Send private message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 7:01 pm    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

"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
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Sat Feb 16, 2008 2:12 am    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

Hi,

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

Kind regards,
Henning

"Maury Markowitz" wrote in
message @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
Back to top
View user's profile Send private message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Tue Feb 19, 2008 12:13 pm    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

"Henning Krause [MVP - Exchange]" wrote:
> most people don't use VBScript or VBA to do this kind of stuff... Smile

Well, what would be the normal solution?

Maury
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Mon Feb 25, 2008 2:36 am    Post subject: Re: Accessing attachments through ODBC? Any ODBC/Exchange gu Reply with quote

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 @microsoft.com...
> "Henning Krause [MVP - Exchange]" wrote:
>> most people don't use VBScript or VBA to do this kind of stuff... Smile
>
> Well, what would be the normal solution?
>
> Maury

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Accessing root folder using MAPI on Exchange 2007 I am trying to open the root folder on Exchange 2007 using MAPI. If I use the following... '\\', I can open the but when I try and open it fails

Accessing Client Contacts programmatically Exchange Server 2003. Outlook 2003. All of our Outlook clients are services by our Exchange Server. I would like to build a program (VBA) that could access the Contacts folder of any or all of our clients. Ultimately, what I want to do is access the c

Accessing mailbox root folder using @PR_IPM_SUBTREE_ENTRYID I have a C application that accesses the root folder of a user's the following... '\\', where I set equal to This has worked fine wi

WebDav Attachments issue! Hi there, I've been struggling for a while to send messages with attachement, it worked once but now I just get an operation time out error. I can send a normal mail easily but the attachment part is a different story. I authenticate using FBA and its an

Use transport agent to remove large attachments Hi, I have to develop an Exchange 2007 transpost agent that handles incoming emails as follows: If an email contains a large attachment, the agent should remove it and put a warning in the email body. This should be done BEFORE the email is written to the
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group