brandonsvac
New Member
- Joined
- Aug 24, 2017
- Messages
- 1
Hey all -
So I've written a Macro to pull in the body of an email from outlook into a worksheet, and I want to be able to allow others to use the macro as well without having to redefine the Outlook MAPI Folder that the email will be drawn from for each individual. Currently, I am using this:
As you can see, the current folder I am accessing is the "Mortgage Presentments" folder within "SPG" within my default Inbox. What I would like to do is have a sheet in the document called "Users" that will hold all of the various file paths that users utilize and have a cell reference VLOOKUP that path.
For purposes of the code, I was hoping to change the back-end of the "Set olFLDR" to set the olFLDR to the path specified by the cell reference.
Any help would be greatly appreciated. Thanks.
So I've written a Macro to pull in the body of an email from outlook into a worksheet, and I want to be able to allow others to use the macro as well without having to redefine the Outlook MAPI Folder that the email will be drawn from for each individual. Currently, I am using this:
Code:
Dim olAPP As Outlook.Application
Dim olNS As Outlook.Namespace
Dim olFLDR As Outlook.MAPIFolder
Dim olITMS As Outlook.Items
Dim olMAIL As Variant
Set olAPP = New Outlook.Application
Set olNS = Outlook.GetNamespace("MAPI")
Set olFLDR = olNS.GetDefaultFolder(olFolderInbox).Folders("SPG").Folders("Mortgage Presentments")
Set olITMS = olFLDR.Items
olITMS.Sort “Subject”
As you can see, the current folder I am accessing is the "Mortgage Presentments" folder within "SPG" within my default Inbox. What I would like to do is have a sheet in the document called "Users" that will hold all of the various file paths that users utilize and have a cell reference VLOOKUP that path.
For purposes of the code, I was hoping to change the back-end of the "Set olFLDR" to set the olFLDR to the path specified by the cell reference.
Any help would be greatly appreciated. Thanks.