Script to open all PST files in a directory and open with Outlook.

Hi!  I am looking for a script that opens all PST files in a directory, opens it in outlook, and writes to a log to see if it completed correctly.  I'm new to VBscript and just want to see how the script would be written.
Thank you!!

Thank you for all the input!  JRV, I went through the repository and couldn't find anything about importing into Outlook.  I will use it for future references and I appreciate you directing me there.
Grant, I need to be able to locate all PST files within a directory, not point it to a specific pst.  I also need it written to a log file.  Here is what I have...Don't laugh, I'm very new...
const ForAppending = 8
set objTextFile = objFSO.OpenTextFile ("C:\Users\jimmy.nguyen\Desktop\Lucky.txt", ForAppending, True)
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
strCommand = "C:\Program Files (x86)\Microsoft Office\Office12\outlook.exe"
Set objExecObject = objShell.Exec(strCommand)
wscript.sleep 4000
Set myOlApp = CreateObject("Outlook.Application")
Set myNS = myolapp.GetNamespace("MAPI")
myNS.AddStore "objfile.name"
Sub ShowSubFolders(fFolder)
Set objFolder = objFSO.GetFolder(fFolder.Path)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If UCase(objFSO.GetExtensionName(objFile.name)) = "pst" Then
objFile.Name
End If
Next
For Each Subfolder in fFolder.SubFolders
ShowSubFolders(Subfolder)
Next
End Sub
strResults = ShowSubFolders(fFolder)
objTextFile.WriteLine(strResults)
objTextFile.Close

Similar Messages

  • How to read all the files in the directory

    Hi,
    I want to read all the files from a directory and perform some operations on them. How to read one file at a time from the directory. Is there any operation like the * sign in Dos and Matlab. Is there any such vi which does that.
    Thanks,
    Nitin

    I'm glad I could help, Danny.  Using the VI Server technique for recursion is very slow and memory-intensive.  I have never seen a need for recursion in LabVIEW that couldn't be solved with a loop and shift registers.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How to create an Index using a script without having to open all the files using BOOK

    Can anyone help me with running a script without opening all the files?

    You cannot access the content of a file that is not open. Your script can open and close files in the background if it's written that way.

  • Can not open all .pdf files in Yahoo Mail.

    Three computers using Windows XP and Internet Explorer can open all .pdf files in Yahoo
    Mail. The fourth and newest Computer with XP Pro, Internet Explorer, and the latest Adobe
    Reader can only open some, but not all, .pdf files in Yahoo Mail. Nothing happens when
    the window is clicked to open file. How can this be fixed?

    Adobe Reader isn't my favorite, but neither are smug and uninformed assertions about Preview. There are PDFs that render only squares and marks under Preview (http://apple.stackexchange.com/questions/24209/this-pdf-displays-with-question-m arks-instead-of-letters), which is a common problem in MS Windows Office generated PDFs, so you may actually need Adobe Reader for Mac.
    If you need to use Adobe Reader (as I do), then it may depend on the filesystem type where you save your PDF.  For example, our Macs are network homed.  Saving to desktop produced the error reported above no matter whether I used Safari:Save As, or the PDF save icon. 
    However, when I saved to a local drive (such as /tmp), then it worked.  I don't know why file system makes a difference, unless Adobe is doing something with extended attributes that doesn't get written correctly to some filesystems.
    Hope this helps.

  • My Preview is open all my pics at time instead of open one by one. It occurs when I try to open any type of JPEG file. That's strange and I'm a new macbook user. I hope somebody can help me out. Thanks

    My Preview opens all my pics at time instead of open one by one. It occurs when I open any JPG FILE. What should I do to fix it? Thanks

    First use JPanel not Panel.
    Panel panels[]=new Panel[4];becomes
    JPanel panels[]=new JPanel[4];Then refactor your code so that you use arrays correctly:
    panels=new Panel();
    panels.setLayout(new FlowLayout(FlowLayout.LEFT));becomes
    panels=new JPanel();
    panels[i].setLayout(new FlowLayout(FlowLayout.LEFT));
    I did the above changes to your code and it worked fine.
    Dave

  • I cannot open archieved pst file in outlook 2010, can someone help me

    Сan some one help me to open my pst file which I had cut copied while moving on to new Laptop, now I cannot open this file in outlook 2010. I tried repairing the file using scanpst and other demo version from kernel and other software... most of them say
    "not a valid pst file" Please help me as the date in this pst is important.

     Your PST file might have got corrupt or damaged with 'Cut Copied' , that's why you are not able to access it on your new Laptop. Could you let me know how did you export your PST file from your old laptop/system?
    A valid way to Export PST file is by using Import & Export option in Outlook (Open Outlook -> File Tab -> Click Options -> Click Advanced -> Import & Export) . Once you export the PST file on your old computer, copy that PST file into
    any external storage drive(or by any other medium) and transfer it to your new laptop. Now open Outlook and Create a new profile ( Click the Show Profiles button -> Click
    Add to create a new profile -> Enter a name for your profile -> Enter Name, Email id & Password -> Click  'Manually configure server settings' box to get into More Settings and
    customize the Outgoing server settings.) Once you are done with this, Import that PST into Outlook using Import & Export wizard.

  • Adobe reader opening all Exe Files.

    I believe I accidently set preferences so that all exe files are opened by adobe reader. Once I uninstalled Adobe reader all .exe files went back to normal. However on re installing Adobe reader all exe files have gone back to opening using adobe reader. When Reader was uninstalled I checked the registry for exe files and was told HKEY_CLASSES_ROOT\.exe
    should have a default value of exefile, which it does and then checked HKEY_CLASSES_ROOT\exefile\shell\open\command which must have a default value of "%1" %* which it does. I can not change the registry while adobe reader is installed as the program regedit is an exe. Is there an Adobe register which I must change or another method I can use?
    Thanks if you understood that.

    If Vista, check this out:
    http://blog.jtbworld.com/2007/03/have-you-lost-your-exe-file-extension.html
    Aandi Inston

  • Acrobat 9 tries to open all .zip files

    Acrobat 9 tries to open all zip files I attempt to download - not just zipped PDF's. Under folder management, the zip file type is not associated with Acrobat and is not showing with a PDF icon. The zip file will not open in any unzipping program, it just goes to Acrobat.
    When I download any zip file I get a message like this:
    Acrobat could not open "somefilename.zip" because it is either not a supported file type or because the file has been damaged.
    This happens with every zip file - how do I disassociate Acrobat from all zip file types?

    You need to change the file type association in Windows Explorer of the Folders Control Panel.
    The easiest way would to use Windows Explorer to find a file with the ".ZIP" file extension and then use the right mouse click to bring up the context menu. You can then select the "Open With..." option, make sure you check the option to set the 'always associate' (it is the only option) and then find WinZip, PKZip, RAR, or what ever program you use to open the "ZIP" type file.

  • Open all TXT files in Ultraedit

    Currently from the below code I am able to open a new empty file in ultraedit. But I need to open all *.txt files from a particular directory in ultraedit. Could anyone please help me with this.
    private void ueditButActionPerformed(java.awt.event.ActionEvent evt)
         java.awt.EventQueue.invokeLater(new Runnable()
              public void run()
                   try
                        Process procViewEd =Runtime.getRuntime().exec("C:\\Program Files\\UltraEdit\\UEDIT32.EXE ");
                   catch(IOException ioe)
                        System.out.println(ioe.getMessage());
    } For instance, when I click on ueditBut, all the txt files inside the path c:\temp should open in ultraedit.
    Message was edited by:
    Simmy
    Message was edited by:
    Simmy

    As an example, this code opens all of the .java files in the current directory using notepad:import java.io.*;
    public class Test {
        public static void main (String... parameters) throws IOException {
            File currentDir = new File (".");
            File[] javaFiles = currentDir.listFiles (new FilenameFilter () {
                public boolean accept (File parent, String filename) {
                    return filename.endsWith (".java");
            for (File javaFile: javaFiles) {
                Runtime.getRuntime ().exec (String.format ("cmd /c notepad %s", javaFile.getAbsolutePath ()));
    }

  • Got a SACD rip and all the files ending .dsf How I open it?

    I new to this 
    I got some music SACD rips and all the files ending .dsf  How I open it?

    double click my domain in the Applications folder in i web
    Just so we're on the same page you mean when you double click on the domain file that's located in your Users/Home/Library/Application Support/iWeb folder, right?
    if we're on the same page try the following:
    delete the iWeb preference file, com.apple.iWeb.plist, that resides in your Home() /Library/Preferences folder.
    go to your Home()/Library/Caches/com.apple.iWeb folder and delete its contents.
    launch iWeb and try again.
    If that doesn't help continue with:
    move the domain file from your Home/Library/Application Support/iWeb folder to the Desktop.
    launch iWeb, create a new test site, save the new domain file and close iWeb.
    go to the your Home/Library/Application Support/iWeb folder and delete the new domain file.
    move your original domain file from the Desktop to the iWeb folder.
    launch iWeb and try again.
    OT

  • Setting Photoshop CS5 as the default for opening all photo files?

    How do I make Photoshop CS5 the default for opening all photo files?

    Close the jpeg in Photoshop! This procedure is done on an unopened (closed) file in the finder, Photoshop is not involved.
    Open a FINDER window, click ONCE to select your file (NOT double click to open it)
    Command I or in the Finder, File menu, select Get Info.
    In the GET INFO window, change the Open With item to Photoshop
    Click the CHANGE ALL button, You will get the warning "This change will apply to all Adobe Photoshop CS5.app documents with extension “.jpg”.
    Click CONTINUE and from now on all jpegs double clicked in the finder will automatically open in Photoshop

  • When trying to open .xps file, I told Firefox to AUTOMATICALLY open all .xps files using xpsviewer.exe & now it opens MANY tabs once I double click on .xps file! How do I stop this?

    When trying to open an .xps file, I told Firefox to AUTOMATICALLY open all .xps files in the future using xpsviewer.exe & now it opens MANY, MANY tabs FAST and continually once I double click on .xps file! How do I stop this? How do I UNselect the AUTOMATIC feature? I do not see where to do this. Also, How DO I open a .xps file successfully in Firefox once this first problem is solved?

    See:
    *https://support.mozilla.com/kb/Firefox+keeps+opening+many+tabs+or+windows

  • Nikon D800 can't open all RAW-files ending .NEF

    Got a Nikon D800 and can't open all RAW-files ending .NEF Most of them no problem, but some I just can't.
    "Could not complete your request because the file appears to be from a camera model" Thats not wight cause I can open like 90% of my .NEF files :/
    Got latest Camera Raw (6.7)..Help please:/

    Because many of the camera makers slightly alter their versions of their raw format whenever they release a new camera model.
    Nikon does it, Canon does it, and also several other camera makers.
    There is not a single version of NEF that all Nikon cameras use, nor a single version of CR2 for all Canon models.
    Here is a list of supported cameras and the required ACR plugin needed to open the raw files.
    Camera Raw plug-in | Supported cameras
    Versions of ACR are specific to each version of Photoshop.
    Older versions of PS cannot use the latest version of ACR.
    You need to download the latest version of Adobe DNG Converter.
    This will convert your newer D800 files to DNGs that can then be opened in older versions like CS5.
    Be aware DNG only works on folders of files, not individual files. Select the FOLDER not a single file

  • I downloaded lion but now I cannot access my word and excel docs for work.  What can be done easily to open all my files?

    I downloaded lion but now I cannot access my word and excel docs for work.  What can be done easily to open all my files?

    tamanacoazur wrote:
    Have not a clue if this a LION problem or Microsoft problem.  My gut says Microsoft as they acknowledge the problem in their support section.  Their solution:  Open files with previous version of Word.  That is completely unacceptable as a solution in my opinion.  Why would have I ever bothered to upgrade to 2011 if I had known I need to keep a version of 2008 running on my computer. 
    Honestly I don't know if it's a Lion or MS problem eihter. I have been using Lion for many months with Office 2011 with no problems though.The earliest version I had on my machine was 2008 and 2011 opened those files with no problems at all. As Dave mentioned earlier he opens Office 2004 files all the time with 2011.
    One thing you might want to do is restart the computer while holding down the Option key then select the Restore Volume and run Disk Utility and repair the Disk Permissions on the HD. Run DP at least 2x.

  • When I open Adobe 9.0 Pro it opens all the files I saved on Friday

    When I open adobe it goes through all of the files I opened on Friday.  When it reachs 50 it freezes up and tells me it can't load more than 50 documents.  I have restarted my computer that didn't work.  I try clicking on a document while it is loading but the says not responding.
    Any ideas.
    Marcy

    tom van haesebroeck said:
    same problem here, since i installed the 9.2 update...
    when i launch acrobat 9.2 pro it opens all the last used pdf's and then it crashes!
    please help
    tom
    this seems to work:
    open acrobat by holding the shift key
    clear history
    close acrobat
    open acrobat again
    Thanks Tom for this!  I am glad I found this thread. 
    I installed Acrobat Pro 9 two weeks ago, and used it fine. 
    This morning, logged in, automatically started installing updates. 
    Then, opening a file in Acrobat, it opened the four I used yesterday.
    Some of them are pretty big, and when I tried to close then, it crashed. 
    I tried to delete history, and then open them. 
    But, following your advice, I:
    Opened Acrobat
    Deleted history
    Closed Acrobat
    Opened Acrobat
    Opened file in Acrobat
    Seems to be working okay now.  Thanks! 
    Still, seems to me that the latest update installment may have a bug. 

Maybe you are looking for