Working Folder for Process.Start when opening  document (.xls, .doc, ...)  with registered application

Posted on 2009-02-13
Last Modified: 2013-12-03
In our application we extract some document from a database  (.xls, .doc, .vsd, .pdf, ...) to allow reading it. Thoose document are generaly created read only and after that, they are opened (ShellExecute) with: System.Diagnostics.Process.Start("@C:\Documents and Settings\MyUser\Local Settings\Application Data\TmpGeneratedFiles\file.xls");

Our problem is that if you click "save or save as" the proposed directory is the folder of the opened file(usually hidden from the user)
Is there a way to change this default folder to Envireonnement.SpecialFolders.Personal?
We tryed the "WorkingDirectory" of ProcessStartInfo and it doesn't work because IsShellExecute = true.  If not? Any other best practice?
Question by:TelDig
    LVL 96

    Expert Comment

    by:Bob Learned
    Are you trying to change the "Save As" location for the Excel, after you create the workbook in one location, to something different?

    Author Comment

    Kind of!

    So we would like to open an existing file from the temporary folder...
    but the save as location of excel/word be in the "my documents"
    (seem more logic because this path should be hidden from the user with standard explorer setting, and the file is readonly... so cannot be overrwrited)

    It's probably impossible (by design)
    I tryed that from command line:
           excel /p "d:\workingfolder\" /r "c:\windows\temp\file.xls"
    and it doesn't work either, the working folder is used only for "new document"

    LVL 96

    Accepted Solution

    No, I don't think that there is any configuration element that you could use to override the "default" behavior that you are seeing with Excel.

    Author Closing Comment


    After investigating more... there is no way to "tune this right" because by desing office suite popup the "save as" dialog in the folder of the current opened document, even if a workdir is specified. Thanks for conformation and help... verry appreciated!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now