4

I have a app that when you click a button it opens a file that is on a SharePoint share. In IE it will open the document in word correctly that if you make changes to the file it will push the changes back to the SharePoint server, however if a user has Firefox as their default browser Firefox will download the file first then use the local copy. Is there a way to force the program to open the link in IE instead of the default browser (or to Word directly, however I need to pass the users domain credentials before I get access to the file)?

BackgroundWorker bw = new BackgroundWorker(); GeneratingChecklist frmProgressBar = new GeneratingChecklist(); frmProgressBar.Show(); bw.DoWork += (sender, e) => { e.Result = Build(AccountNumber, PracticeName, ContractID, EducationDate, MainContactInfo, Address); }; bw.RunWorkerCompleted += (sender, e) => { frmProgressBar.Close(); running = false; if (e.Result != null) { System.Diagnostics.Process.Start(((FileDetails)e.Result).Address); } else { MessageBox.Show("An error occurred generating or retrieving the educator checklist."); } }; bw.RunWorkerAsync(); 

FileDetails.Address contrains the url to the word document.

1 Answer 1

15

Try:

System.Diagnostics.Process.Start("iexplore.exe", "http://sp.path.to/your/file.doc") 

See the MSDN documentation for more information about opening processes with arguments.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that works. I will check as accepted answer when the 15 min limit is up

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.