Where do the attachments go?

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

Outlook 2k, WinXP Pro.

Hi there.

When O2k connects to a server and an attachment is downloaded, exactly where
does it go?

I want to design an MS Access application that (amongst other things)
extracts the attachments in your Inbox to another location.

Many thanks.
Keith.
www.keithwilby.org.uk
 
Assuming that you are working with an IMAP/POP/SMTP mailbox, the attachment
is stored in the Personal Folder (PST) file right along with everything
else.
 
Thanks for the response. Is it possible to access the attachments using
Office Automation say from Access?
 
Many thanks. I had already looked there but I can't find anything about
handling attachments. Could you point me in the right general direction
(sorry to be such a pain ;-)).
 
This is a complex sample:
http://www.outlookcode.com/d/code/quarexe.htm

Here is an Outlook VBA macro:

' sample requires an item to be open.
' change activeinspector to activeexplorer
' if working with an item displayed in preview only

Sub SaveAttachment()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments

For Each objAttachment In colAttachments
objAttachment.SaveAsFile ("C:\" & objAttachment.FileName)
Next

Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing

End Sub
 
Superb! Many thanks indeed.

neo said:
This is a complex sample:
http://www.outlookcode.com/d/code/quarexe.htm

Here is an Outlook VBA macro:

' sample requires an item to be open.
' change activeinspector to activeexplorer
' if working with an item displayed in preview only

Sub SaveAttachment()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments

For Each objAttachment In colAttachments
objAttachment.SaveAsFile ("C:\" & objAttachment.FileName)
Next

Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top