Guide me how to encrypt a word in VB
Â
Hi, I have some important MS word files. I need them to encrypt in visual basic. So, can you please guide me how to encrypt a word in VB?
Â
Hi, I have some important MS word files. I need them to encrypt in visual basic. So, can you please guide me how to encrypt a word in VB?
Hi Kayla,
I will outline a few steps and code you can use to encrypt your MS word files in VB.Net.
Below is the VB.Net code for encrypting your document:
Import System
import Spire.Doc
import Spire.Doc.Documents
Namespace Encrypt_Word
     Friend Class Encryption
          Shared Sub Main(ByVal args()As String)
                  Dim document As New Document()
                  document.LoadFromFile("file path of your text file e.g D:workMy DocumentsEssay.Docx")
                  document.Encrypt("the password you will use e.g 124553")
                  document.SaveToFile("Encryption.docx", FileFormat.Docx);
                  System.Diagnostics.Process.Start("Encryption.Docx")
          End Sub
    End Class
End Namespace
You can get the other implementations apart from VB.Net from here
I hope this helps.