A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Save Attachment via VBA



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6  
Old January 14th 08, 05:16 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Save Attachment via VBA

Your welcome Roger!

The AdvancedSearch function is in Outlook:

AdvancedSearch Method:
http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

Info on DASL:

Tips for DASL searches:
http://www.outlookcode.com/news.aspx?id=30

You use the Create View dialog in Outlook as the tool to help build the
search strings for the AdvancedSearch method. Let me know if you need
anything clarified.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Roger Converse" wrote:

Thank you for the replies, BTW. I think I forgot that on my other post.

Well, it would probably be ideal if I could keep everything in Access.

I checked the AdvancedSearch function in Access and was not even sure what
that meant? What would the scope as string be?

I am going to look at it much more tonight when I get home, but I was
definitly lost in your points 1 + 2 from your previous post. What is DASL?

I also don't know what this is: "You can easily build your search critieria
by creating a view and using the options in the Filter property sheet - then
switch to the SQL tab to see the full search syntax."

Are you referring to the design view for queries? I am confused by
"property search".

Thank you,
Roger

"Eric Legault [MVP - Outlook]" wrote:

It really depends on where you want the code to run. You either set a
reference to the Outlook Object Model in your Access project and read your
table data there through whatever means makes sense (bound control calling a
function, Access macros, ADO/DAO, etc.), or use ADO or DAO in an Outlook
macro to read your table data.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Roger Converse" wrote:

So, just to make sure I understand, you are saying that I can control this
all through Access VB and I won't have to create a macro in Outlook?

Thanks,
Roger

"Eric Legault [MVP - Outlook]" wrote:

You have the Has Attachments column in an imported or linked table from an
Outlook folder to determine if an attachment is present (value = -1).
However, you do not have the EntryID value to work with to uniquely identify
the message to retrieve using the Outlook Object Model. First you'll have to
use the AdvancedSearch method to return a Results collection to find the
message in question. This will require two criteria:

1) The DASL property for finding an attachment:
"urn:schemas:httpmail:hasattachment" = 1
2) One or more other DASL properties that can help retrieve a unique e-mail,
necessary if there are e-mail threads with duplicate sender names and subject
lines. One property search example would be "urn:schemas:mailheader:subject
= 'Office Holiday Party'". You would need to concatenate multiple critieria
with the AND keyword. However, keep in mind you are limited to the
properties that are exposed to Access (and hence the Outlook DASL equivalent
property names).

You can easily build your search critieria by creating a view and using the
options in the Filter property sheet - then switch to the SQL tab to see the
full search syntax.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Roger Converse" wrote:

Hello,

I have my inbox linked to an Access DB. Is there a way to create a macro
that will save an attachment from an e-mail? If so, what would be a
difficulty level of completing? Basically, I would like to setup some
criteria in access that decides if an e-mail has an attachment and keyword in
the subject line, then call object Outlook and save the attachment. At that
point, Access would take back control and run a routine.

I have coded VB in Excel and Access, but never Outlook.

Any suggestions welcome!

Thank you,
Roger

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Save Attachment Pavan Outlook - Using Forms 1 August 14th 07 02:36 PM
Hijack Attachment Save As... DG Outlook and VBA 1 July 30th 07 02:29 PM
Save and Remove Attachment gustavo souza Outlook and VBA 0 July 27th 07 12:31 AM
a 10 k word doc attachment save as ...become 13M itcom Outlook - Installation 1 March 15th 07 04:39 AM
save attachment in calendar jvl_runner Outlook - Calandaring 1 January 22nd 07 01:21 PM


All times are GMT +1. The time now is 02:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.