Hi all,
Is there a way to refer to a inbox other than the default using VBA? At work, I have access to my email and two others. My VBA is for one of the other mailboxes not my own. My code is below.
Thanks
Lisa
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim SubFolder As MAPIFolder
Dim ManualFolder As MAPIFolder
Dim AppRecdFolder As MAPIFolder
Dim Item As MailItem
Dim ItemCopy As MailItem
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Dim InFileName As String
Dim FCheck As String
Dim varResponse As VbMsgBoxResult
Dim objXLApp As Object
Dim objXLBook As Object
Dim EMSentDateTime As String
Dim EMReceivedDateTime As String
Dim EMSentDate As Date
Dim EmSentTime As Date
Dim EMReceivedDate As Date
Dim EMReceivedTime As Date
Dim senderAdd As String
Dim EMSubject As String
Dim attachSavePath As String
Dim attachFileName As String
Dim AllAtmtsThere As String
Dim strExt As String
HAFileName = "HACodesForCompEmails.xlsx"
attachSavePath = "J:\Attachments\"
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
Set SubFolder = Inbox.Folders("Applications")
Set ManualFolder = Inbox.Folders("ApplicationsForManualReview")
Set AppRecdFolder = Inbox.Folders("ApplicationsReceived")
Const EXTENTION As String = " zip"
Const SUBFILE As String = "J:\Applications-Report.csv"
i = 0
' Check subfolder for messages and exit if none found
If SubFolder.Items.Count = 0 Then
MsgBox "There are no messages in the Applications folder.", vbInformation, _
"Nothing Found"
Exit Sub
End If
Is there a way to refer to a inbox other than the default using VBA? At work, I have access to my email and two others. My VBA is for one of the other mailboxes not my own. My code is below.
Thanks
Lisa
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim SubFolder As MAPIFolder
Dim ManualFolder As MAPIFolder
Dim AppRecdFolder As MAPIFolder
Dim Item As MailItem
Dim ItemCopy As MailItem
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Dim InFileName As String
Dim FCheck As String
Dim varResponse As VbMsgBoxResult
Dim objXLApp As Object
Dim objXLBook As Object
Dim EMSentDateTime As String
Dim EMReceivedDateTime As String
Dim EMSentDate As Date
Dim EmSentTime As Date
Dim EMReceivedDate As Date
Dim EMReceivedTime As Date
Dim senderAdd As String
Dim EMSubject As String
Dim attachSavePath As String
Dim attachFileName As String
Dim AllAtmtsThere As String
Dim strExt As String
HAFileName = "HACodesForCompEmails.xlsx"
attachSavePath = "J:\Attachments\"
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
Set SubFolder = Inbox.Folders("Applications")
Set ManualFolder = Inbox.Folders("ApplicationsForManualReview")
Set AppRecdFolder = Inbox.Folders("ApplicationsReceived")
Const EXTENTION As String = " zip"
Const SUBFILE As String = "J:\Applications-Report.csv"
i = 0
' Check subfolder for messages and exit if none found
If SubFolder.Items.Count = 0 Then
MsgBox "There are no messages in the Applications folder.", vbInformation, _
"Nothing Found"
Exit Sub
End If