Outlook is most commonly used emailing application used in the world. Many people spend their entire day on Outlook applications to read and respond to emails. To automate certain rule-based tasks in Outlook, we can take the help of VBA. Below is one of the commonly used VBA codes to browse an Outlook folder. The code returns two values:
You can also read my post for reading Outlook emails in Excel
Public Sub PickOutlookFolder()
'Microsoft Outlook XX.X Object Library is required to run this code
'Variable declaration
Dim objNS As Namespace
Dim objFolder As Folder
Dim strFolderPath As String
Dim strEntryID As String
'Set Outlook Object
Set objNS = Outlook.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If TypeName(objFolder) <> "Nothing" Then
strFolderPath = objFolder.FolderPath
strEntryID = objFolder.EntryID
End If
'Close the objects
Set objFolder = Nothing
Set objNS = Nothing
'Show the selected folder details on Excel sheet
Sheet1.Range("B6").Value = strFolderPath
Sheet1.Range("C6").Value = strEntryID
End Sub
It is worth to mention that you need to add Outlook reference (Microsoft Outlook XX.X Object Library) in Excel VBA from Menu Bar (Tools>ReferencesâŚ). Below are the steps to add Outlook reference in Excel VBA:
1. From the Menu Bar, click on Tools > ReferencesâŚ
2. Select âMicrosoft Outlook XX.X Object Libraryâ and click on âOKâ button
1. Open an Excel file
2. Press Alt+F11
3. Insert a Module (Insert>Module) from menu bar
4. Paste the code in the module
5. Now add a shape in Excel sheet
6. Give a name to the shape like âBrowse Outlook Folderâ
7. Right click on the shape and select âAssign MacroâŚâ
8. Select PickOutlookFolder from the list and click on âOkâ button
9. Done
Working with huge data is always exciting and challenging. From 2007 version onward, Excel is supporting more than a million rows in each worksheet. One of the common problems with huge data is âDuplicatesâ and the bigger problem is to identify and remove these duplicates. In this article, we will be sharing 4 ways to delete duplicate records from your data.
Random Rows Selector is an MS Excel based tool which can be used to pick random or stratified samples from a set of records available in Excel.
In MS Access, the best way to create a multiuser tool is to divide your solution. One part acts as interface and other one acts as database. You can have multiple copies of the interface distributed to users which are connected to central MS Access database saved at common shared drive. To connect the interface to database, you can use link table feature (Access>External Data>Import & Link) available in MS Access. Below is a commonly required VBA code which helps the developers to re-link MS Access linked tables when the database is renamed or moved to other location
Excel Add-in helps you to extend the features of Excel application. Using Excel Add-in, you can perform custom actions in Excel such as formatting the data, doing complex calculations which are not possible through Excel formulas, Reading or Writing data in other Excel files and so many more actions.
VBA code that will sum cells by its color through excel function. This code will really help in making the analysis and presentation better.
VBA Code to Filter Data in Excel Here is an easy reference code which filters data in the sheet. In the code, we have filtered the data in three steps. Step 1:Â Remove existing filter from…