how to save excel file attached in an email received in a defined sub folder in the inbox of outlook 2007 to a folder on the windows?

前端 未结 1 1934
感动是毒
感动是毒 2021-01-14 22:28

i need to save the excel attachement received inside outlook messages in a specific sub folder (daily final) located in the inbox and knowing that all the emails in that sub

相关标签:
1条回答
  • 2021-01-14 22:48

    It seems you have cut-and-pasted from a website but you are not familiar with VBA. When you paste code into the VBA Code wondow, it will highlight lines where there are problems. You then apply your knowledge to fix these problems. For example, this line from above should be one statement:

    MsgBox "There are no messages in the Sales Reports folder.",
    vbInformation , _
     "Nothing Found"
    

    Like so:

    MsgBox "Message", buttons, "Title"
    

    You can put a statement on three lines like you have it, but you must use the line continuation character (_), you only have one, you need two.

    MsgBox "There are no messages in the Sales Reports folder.", _
    vbInformation , _
     "Nothing Found"
    

    Here

    FileName = "C:\Email Attachments\" & _
     Format(Item.CreationTime, "yyyymmdd_hhnnss_") &
    

    You have an extra &. A statement cannot end with &

    The F1 key can be very helpful in these situations.

    0 讨论(0)
提交回复
热议问题