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

Posted on 2009-02-13
Medium Priority
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
  • 2
  • 2
LVL 96

Expert Comment

by:Bob Learned
ID: 23640353
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

ID: 23646910
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

Bob Learned earned 2000 total points
ID: 23651259
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

ID: 31546596

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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

807 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