reqopjoe.blogg.se

Open shared inbox outlook
Open shared inbox outlook













'Filter the items from the inbox based on the sender Set outlookInbox = outlookApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox) 'Set a reference to Outlook's object library (Visual Basic > Tools > References > check/select Microsoft Outlook Object Library)ĭim outlookRestrictItems As Outlook.Itemsĭim outlookLatestItem As Outlook.MailItemĭim outlookAttachment As Outlook.AttachmentĬonst saveToFolder As String = "C:\Users\jalanger\Desktop\Demo" 'change the save to folder accordinglyĬonst senderName As String = "Langer, Jaclyn" 'change the sender name accordinglyĬonst attachmentName As String = "Report on ACBS LC for AMLS (Chandran Panicker)" 'change the attachment name accordingly How can I edit this code so it searches in this mailbox and not in my own Inbox? Option Explicit Assume the email address at which this shared mailbox receives emails is This is obviously separate from my own personal email address. However, I want to edit the code so that it searches not in my default Inbox, but in a different, shared mailbox in my Outlook. It then saves the attachment to a designated folder on my desktop while renaming the file with the date on which the email was received. Original Post: I have this code that I run in Excel VBA that searches for a specific sender and attachment name in my Outlook default Inbox. Set outlookInbox = NS.GetSharedDefaultFolder(objOwner, olFolderInbox) MsgBox objOwner.Name 'You can comment this out if you want

open shared inbox outlook

Edit: I actually figured this out! I replaced the line Set outlookInbox = outlookApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)















Open shared inbox outlook