Inputting text to text field in password protected document

H

hlam

Is there a way that I can input text via VBA thru Access 2000 to text form
fields word document that is write protected and how?

This word document is created from headquarter that cannot be unprotected
without a password. I am thinking as I can type in text in text fields I
should be able to type in text in VBA even though it is protected if I am
right.

Here are the codes I am using but is not working:

Dim wd As Object
Set wd = CreateObject("word.application")
wd.Documents.Open "F:\testing"
wd.Parent.Visible = True
wd.Activate
wd.ActiveDocument.Bookmarks("FirstName").Select
Selection.TypeText Text:="Hello" ** error message

** error message: Method 'Selection' of object '_Global' failed
** if I use "wd.Selection.TypeText Text:="Hello" it gives me message
that document is protected
 

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