PC Review


Reply
Thread Tools Rate Thread

Automatically detaching an attachment to a PC Folder

 
 
Karen Middleton
Guest
Posts: n/a
 
      22nd Mar 2005
Everyday I get a email with the same subject line and one text file
attachment.

I am new to Outlook kindly provide me a step by step procedure to
automatically export the text file attachment into the local PC
folder.

After exporting the text file to the local PC folder I want to trigger
a Windows executable.

I would appreciate if you could kindly provide me the process for
setting up this process automation in Outlook.

Can I also use Outlook Express.

Thanks
Karen
 
Reply With Quote
 
 
 
 
Helmut Obertanner
Guest
Posts: n/a
 
      22nd Mar 2005
Hello Karen,

you could do that with a VBA script in Outlook.
This sample script checks for new arrived Emails (unread) and see if it had
PDF Files attached.
If so, the attachments are save to a Folder on Harddisk. (C:\Temp)
If you want to start an executable you can do that with a wshshell object.

Hope this get you started.

Start Outlook, Press Alt+F11
Double click Outlook Session

Paste in this code...

-------------------------- Begin of
Code -----------------------------------------

'
' By Helmut Obertanner
' DATALOG Software AG 2005
' http://www.datalog.de
' Saves PDF File from incomming Attachments to C:\Temp
'
' Install:
'
' Start Outlook
' Press 'Alt + F11'
' Double Click on Outlook Session
' Paste this code below
'
Private Sub Application_NewMail()

CheckForPDFFiles

End Sub

Private Sub CheckForPDFFiles()
Dim objItems As Outlook.Items
Dim objInbox As MAPIFolder
Dim objMail As Outlook.MailItem
Dim objAttachment As Outlook.Attachment
Dim strFileName As String
Dim strTargetPath As String

On Error Resume Next

' Get the Inbox Folder
Set objInbox = Session.GetDefaultFolder(olFolderInbox)

' Get new unread Mails from Inbox folder
Set objItems = objInbox.Items.Restrict("[MessageClass] = 'IPM.Note' AND
[Unread] = true")

For Each objMail In objItems
'Check if we have attachments

For Each objAttachment In objMail.Attachments

'Check if we have a .PDF File
strFileName = LCase(objAttachment.FileName)

If Right(strFileName, 4) = ".pdf" Then
objAttachment.SaveAsFile ("C:\Temp\" &
Format(objMail.ReceivedTime,"yymmddhhMMss") & "-" & strFileName)

End If

Next

Next
End Sub

-------------------------- End of
Code --------------------------------------------

--
with regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!

"Karen Middleton" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Everyday I get a email with the same subject line and one text file
> attachment.
>
> I am new to Outlook kindly provide me a step by step procedure to
> automatically export the text file attachment into the local PC
> folder.
>
> After exporting the text file to the local PC folder I want to trigger
> a Windows executable.
>
> I would appreciate if you could kindly provide me the process for
> setting up this process automation in Outlook.
>
> Can I also use Outlook Express.
>
> Thanks
> Karen



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I automatically save an attachment to a folder =?Utf-8?B?Y2Fyb2w=?= Microsoft Outlook VBA Programming 1 9th May 2007 10:54 PM
Automatically detaching attachments in Outlook =?Utf-8?B?ZGVsZW9tZXllcg==?= Microsoft Outlook Discussion 2 3rd Jan 2006 06:20 PM
Automatically detaching an attachment to a PC Folder Karen Middleton Microsoft Outlook Discussion 1 22nd Mar 2005 12:13 PM
Automatically detaching an attachment to a PC Folder Karen Middleton Microsoft Outlook 1 22nd Mar 2005 12:13 PM
How do I automatically move an attachment to a folder. =?Utf-8?B?SWFuRw==?= Microsoft Outlook Discussion 1 11th Jan 2005 03:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:10 AM.