View Single Post
 
Old 10-19-2014, 01:42 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The line that determines the folder to process is

Code:
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(6) 'Inbox
If 'Backup' is a sub folder of Inbox then you need

Code:
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(6).Folders("Backup")
The Attachments issue is less clear cut. It will depend on whether the message is plain text or html and if the latter whether there are any graphics in the message. Plain text messages should only produce an attachments count when there are actually attachments. HTML will have additional 'attachments' in the count to reflect graphics in the message.

You could count the attachments and then based on the count (less any graphics) determine what you add to your data table.
e.g.
Code:
Dim bAttach as Boolean
'................
If Mailobject.Attachments.Count > 0 then 
 bAttach = True
Else
bAttach = False
End If

'..................

!Attachments = bAttach
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote