Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can someone tell me how to move attachments to a folder at path "C:\data\input"
i will use it with my 'outlook rules' by running a script and after that a SSIS package to import into database. thank you

Stuck with this
Item.Move (Session.GetDefaultFolder(olFolderInbox).Folders("Move"))
can i use this
Item.Move ("c:\data\input")


i am using this code in scripts
VB
Sub MoveMail(Item As Outlook.MailItem)
 
If Item.Attachments.Count > 0 Then
 
Dim attCount As Long
Dim strFile As String
Dim sFileType As String
 
attCount = Item.Attachments.Count
 
For i = attCount To 1 Step -1
      strFile = Item.Attachments.Item(i).FileName
       
      sFileType = LCase$(Right$(strFile, 4))
     
    Select Case sFileType
        Case ".csv", ".xls", "xlsx"
      Item.Move (Session.GetDefaultFolder(olFolderInbox).Folders("Move"))

       GoTo endsub
      End Select
  Next i
 
End If
  
endsub:
 
  Set Item = Nothing
  
End Sub
Posted
Comments
Maciej Los 5-Jan-14 16:16pm    
The question is: How to move attachment, but you're trying to move mailitem... So, which meets your needs?

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900