change password excisting word document

N

nekesbrenddaddy

Hello, i'm very new to the vb.net framework.
This is my problem : i have a word document with a password-protection.
And the password is known.
I want to sent this document by email with another password.
So i have to copy the password-protected-word document and change the
pasword of the new document.

Please help me out here. Havent got a clue.
Thank You in advance.
 
J

Jean-Guy Marcil

nekesbrenddaddy was telling us:
nekesbrenddaddy nous racontait que :
Hello, i'm very new to the vb.net framework.
This is my problem : i have a word document with a
password-protection. And the password is known.
I want to sent this document by email with another password.
So i have to copy the password-protected-word document and change the
pasword of the new document.

Try something like this with a document that has "test" as a password to
open it:

Dim myDoc As Document

Set myDoc = Documents.Open(FileName:="C:\MyPath\Password.doc", _
PasswordDocument:="test")
With myDoc
.Password = "123"
.Close wdSaveChanges
End With


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top