J
Justin
I use the following routine to open a word doc and protect it with password.
Presently the file is not getting closed properly. I admit that I am new to
Office development. What is wrong in the following code? Will it work with
any version of Word? Also give me the website address which has sample codes
related to Office development using VB.NET
dim strFilename as string = "c:\doc1.doc"
dim oWord as new word.application
dim oWordDoc as new word.document
oWordDoc=oWord.Documents.Open(strFileName)
with oWordDoc
..protect(word.wdprotectiontype.wdAllowOnlyomments,False,"xyz")
..saved=true
..close(true)
end with
oWordDoc=Nothing
oWord.quit
Presently the file is not getting closed properly. I admit that I am new to
Office development. What is wrong in the following code? Will it work with
any version of Word? Also give me the website address which has sample codes
related to Office development using VB.NET
dim strFilename as string = "c:\doc1.doc"
dim oWord as new word.application
dim oWordDoc as new word.document
oWordDoc=oWord.Documents.Open(strFileName)
with oWordDoc
..protect(word.wdprotectiontype.wdAllowOnlyomments,False,"xyz")
..saved=true
..close(true)
end with
oWordDoc=Nothing
oWord.quit