If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
open some pst files at once in outlook
Hello,
I need to open several pst file in my outlook to compare some relevant emails in them. I find that I can only open one pst file every time by using "Open Outlook Data File” button. So I need to open them one by one . Can I have a button to open several pst files at once in outlook ? Thank you. |
Ads |
#2
|
|||
|
|||
Hi, PamLnnle,
For that, you can write VBA codes to do that. Try below macro. First, put all the pst files which you need to open into a same folder. Then run this macro. Please note you need to change the folder path "E:\" into your real path in code "Call LoopFolders("E:\") " Sub BatchOpenMultiplePSTFiles() 'You can change the path as per your needs 'You can also specify a folder other than a drive 'For instance - Call LoopFolders("C:\Users\Test\My Documents\Outlook Files") Call LoopFolders("E:\") MsgBox "Open Successfully!", vbExclamation + vbOKOnly, "Open Outlook Data File" End Sub Sub LoopFolders(strPath As String) Dim objFileSystem As Object Dim objFolder As Object Dim objFile As Object Dim objPSTFile As Object Set objFileSystem = CreateObject("Scripting.FileSystemObject") Set objFolder = objFileSystem.GetFolder(strPath) For Each objFile In objFolder.Files 'Find the pst file by file extension strFileExtension = objFileSystem.GetExtensionName(objFile) If LCase(strFileExtension) = "pst" Then Set objPSTFile = objFile 'Open the PST file Outlook.Application.Session.AddStore (objPSTFile.Path) End If Next 'Process all folders and subfolders in the Local Drive E If objFolder.SubFolders.Count 0 Then For Each objSubFolder In objFolder.SubFolders 'Skip the system and hidden folders If ((objSubFolder.Attributes And 2) = 0) And ((objSubFolder.Attributes And 4) = 0) Then LoopFolders (objSubFolder.Path) End If Next End If End Sub And I also attach th link of the codes he https://www.datanumen.com/blogs/batc...files-outlook/ Hope it helps. Last edited by Rachal : May 22nd 17 at 10:24 AM. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook set to look for offline files--will not open | Mr. Coffee | Outlook - Installation | 1 | April 6th 08 07:09 PM |
Why can't I open .jpg files in Outlook. | Darcy F | Outlook - Using Contacts | 1 | May 31st 07 10:26 AM |
Windows Explorer 7: Lost game files & fighting to open files & bro | Totally Frustrated 7 | Outlook Express | 4 | February 2nd 07 03:07 PM |
can't open pps. files in outlook | davwand | Outlook Express | 1 | January 7th 07 09:59 AM |
outlook client cannot open Tif files | Bill | Outlook - Fax Functions | 3 | July 17th 06 09:53 PM |