• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Error Getting while downloading from outlook mail

Hi ,

Need your help

I have macro to extract mail subject ,received time ,sender which is attached
macro is not working could you please help me

upload_2017-6-5_22-8-23.png

and also I want one more help in the macro can we line
like in the subject line it will mentioned with some company code name
like A010 in the folder could you also help with that

Many thanks for your help.

Regards
Giriraj
 

Attachments

  • outlook mail daily download - Copy.xlsm
    14.5 KB · Views: 2
Try...
Code:
Dim OutlookApp As Object
Dim OutlookNamespace As Object

I'm guessing that since you don't have reference to Outlook library, it's giving the error you mentioned.
 
Hi Chihiro,

Thanks for reply .

yes that is the folder in my inbox "SBS BLR JOURNAL LATAM CHCG" and the mails in the inbox.
upload_2017-6-6_3-33-44.png
 
If it's default then you just need.
Code:
Set Folder = OutlookNamespace.GetDefaultFolder(olFolderInbox)
 
Hi Chihiro,

Sorry there are other folders in my mail box this is one of the folder which I want to track the mails received on daily basis folder name is "SBS BLR JOURNAL LATAM CHCG" in that Inbox.

regards
Giriraj
 
It does not matter if there are other folders. As long as the folder that you are interested is the default "Inbox". Did you test it?

If not, I'll need more details to help you (such as if there are multiple accounts, or just one account, folder structure etc).

You may find the link useful.
https://www.slipstick.com/developer/working-vba-nondefault-outlook-folders/

Edit: You may want to use early bind with reference to Microsoft Outlook object library. Which will give you benefit of being able to object members and methods.
 
Without full detail of your folder structure. Can't really help you.

But assuming it's 2 layer structure. You can access it by.

Code:
Set Folder = OutlookNamespace.Folders("Parent Folder Name").Folders("Sub Folder Name")
 
Hi Chihiro,

Many Thanks for your Help!!
After adding the line now the macro is working fine, however the macro is not stopping and after 30 minutes the macro will stop and return me the below error .

I have question can we add "received date " and "to date " like 6/8/2017 to 6/8/2017 ,now currently I have only received date , may be that is the reason
it is taking too long time .

upload_2017-6-8_21-50-58.png
 

Attachments

  • outlook mail daily download - Copy.xlsm
    16.4 KB · Views: 2
Back
Top