Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey

My problem is that I need to open a word, excel or pdf document from a path that is saved in my database (SQL Server 2008) and the actual file is stored on the hard drive.

I'm coding in asp.net and when I open the document it's in an incorrect format with random symbols.

Can anyone please help me?
Thanks in advance

UPDATE from OP:
Sorry im a new member of code project.

Im able to store the document in the root folder of my application and im able to store the file path name in a table in SQL, but i dont know how to get the document to open in word using the saved file path. Here is how ive tried to open the file in a button click event.
Posted
Updated 11-Aug-10 6:55am
v3
Comments
Sandeep Mewara 11-Aug-10 9:47am    
You need to provide more details. What do you mean by 'incorrect format', 'random symbols'?
Add a code snippet that is pulling and showing the document.
Dalek Dave 11-Aug-10 10:18am    
Minor Edit for Readability.
Sandeep Mewara 11-Aug-10 12:56pm    
Your code part is missing. Edit your question and add it.

1 solution

Use System.Diagnostics.Process.Start. You will start Word and you will pass the path as a startup parameter.
 
Share this answer
 
Comments
**Butterfly Girl** 11-Aug-10 14:58pm    
Thanks that helped loads :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900