Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I encrypt word doc with my method.
I need to that when double click on word document decrypt it and open it.I dont use encrypt command of office.
Posted 11-Nov-12 2:54am
Comments
Nelek at 11-Nov-12 8:26am
   
And where are you having problems?
Tinier at 11-Nov-12 22:00pm
   
what is your method?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The you'll have to associate the Word file extensions with your application. This will have the effect of opening your decryption application where you can then decrypt the file, but then your application will be responsible for opening Word with the correct command line parameters to open the file.
 
Your decryption code will also have to determine if the file is indeed encrypted because you'll be responsible for opening ALL Word documents, whether or not they are encrypted.
  Permalink  
Comments
khayambehroozy at 11-Nov-12 10:40am
   
I need have plugin in word,and do it with plugin,but plugin have open method and occurs after open file with word,I need it before open file with word,
I think can do it with API,but I cant do it,if any one can help me
Dave Kreskowiak at 11-Nov-12 11:37am
   
How did you do the encryption? If this was a plugin, under which event was your code called??
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hello,
 
Is there a password to encrypt your document? If so, you can try to use the following code:
 
            Document document = new Document();
            document.LoadFromFile(@"E:\work\Documents\welcome.docx", FileFormat.Docx, "123456");
            document.SaveToFile("decryption.docx", FileFormat.Docx);
 
And I use a .NET Word component which is introduced here: http://www.codeproject.com/Catalogs/3773/Spire-Doc-for-NET.aspx[^]
 
If no password or you don't know the password,I think it is a little complicated to decrypt.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 279
1 OriginalGriff 190
2 DamithSL 185
3 Peter Leow 105
4 Kornfeld Eliyahu Peter 105
0 OriginalGriff 7,355
1 DamithSL 5,254
2 Sergey Alexandrovich Kryukov 4,942
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 11 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100