T
Tim
Hi everyone,
I posted my question in Access's newsgroup, but someone
referred me to here. I have the following code to add
password to my word document from access.
Dim oWord As Object
Set oWord = CreateObject("word.application")
oWord.Visible = True
oWord.Documents.Open "c:\TempDoc\test.doc"
oWord.ActiveDocument.SaveAs
filename:="c:\tempdoc\test.doc", Password:="123"
oWord.ActiveDocument.Close
oWord.Quit
Set oWord = Nothing
End Sub
The code looks like fine, but it doesn't add the password
to my document. If I changed oWord.ActiveDocument.SaveAs
filename:="c:\tempdoc\test.doc", Password:="123" to
oWord.ActiveDocument.SaveAs filename:="test.doc",
Password:="123", then it will add the password to test.doc
in word's default folder not my original folder -TempDoc.
Does anyone know how to add password
to"c:\tempdoc\test.doc"?
Thanks in advance.
Tim.
I posted my question in Access's newsgroup, but someone
referred me to here. I have the following code to add
password to my word document from access.
Dim oWord As Object
Set oWord = CreateObject("word.application")
oWord.Visible = True
oWord.Documents.Open "c:\TempDoc\test.doc"
oWord.ActiveDocument.SaveAs
filename:="c:\tempdoc\test.doc", Password:="123"
oWord.ActiveDocument.Close
oWord.Quit
Set oWord = Nothing
End Sub
The code looks like fine, but it doesn't add the password
to my document. If I changed oWord.ActiveDocument.SaveAs
filename:="c:\tempdoc\test.doc", Password:="123" to
oWord.ActiveDocument.SaveAs filename:="test.doc",
Password:="123", then it will add the password to test.doc
in word's default folder not my original folder -TempDoc.
Does anyone know how to add password
to"c:\tempdoc\test.doc"?
Thanks in advance.
Tim.