Hi all,
I have a macro which downloads attachments based on a given Download Path (F1), Date Range (F2 & F3), Attachment extension/ type (F5), Main Folder Name (F6) and Sub-folder name (F7).
I want to be able to download attachments in a specific folder in my mailbox but it doesn't work when I simply want to download attachments in "Inbox" it only works if I want to download attachments in my Sub-folders. for example assuming the following is my mailbox structure:
[IMG alt="Name: Screenshot1.png
Views: 17
Size: 2.8 KB"]Excel Help Forum
If I use this code to download attachments in my Inbox, where F6 value is My mailbox name and F7 is set to "Inbox" it give me type miss match error.
but if I change it to this, it gets me the right attachments in the Read Later subfolder.
Why is the first case failing and how to fix it?
Thanks,
Alex
I have a macro which downloads attachments based on a given Download Path (F1), Date Range (F2 & F3), Attachment extension/ type (F5), Main Folder Name (F6) and Sub-folder name (F7).
I want to be able to download attachments in a specific folder in my mailbox but it doesn't work when I simply want to download attachments in "Inbox" it only works if I want to download attachments in my Sub-folders. for example assuming the following is my mailbox structure:
[IMG alt="Name: Screenshot1.png
Views: 17
Size: 2.8 KB"]Excel Help Forum
If I use this code to download attachments in my Inbox, where F6 value is My mailbox name and F7 is set to "Inbox" it give me type miss match error.
VBA Code:
Set Folder = Outlook.GetNamespace("MAPI").Folders(Sheet.Range("F6").Value).Folders(Sheet.Range("F7").Value)
but if I change it to this, it gets me the right attachments in the Read Later subfolder.
Code:
Set Folder = Outlook.GetNamespace("MAPI").Folders(Sheet.Range("F6").Value).Folders(Sheet.Range("F6").Value).Folders(Sheet.Range("F7").Folders("Read Later")
Why is the first case failing and how to fix it?
Thanks,
Alex