Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to open a MS Word File in Read Only using C#.
I have some conditions in my code, based on that I want to open it in Readonly mode.

Any help would be really appreciated.

Regards,
Pawan.
Posted
Updated 8-Sep-10 4:11am
v2

1 solution

Here you go:
Creating and Opening Microsoft Word Documents from .NET Using C#[^]

Make the readOnly property as true while opening and you should be ready to go!
 
Share this answer
 
Comments
Pawan Kiran 25-Jun-10 4:51am    
Hi
Thanks for your Reply

I solved myself using FileInfo Class.
i acheived this using FileAttributes.ReadOnly.

Regards,
Pawan.
Dalek Dave 8-Sep-10 10:12am    
More or less what I would have said.
Lisa775 12-Apr-18 5:54am    
when u use FileAttributes.ReadOnly the user can edit but cant save ????

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