Text input in a password protected document

H

hlam

The following macro is captured from a word document to open another word
document that is password protected and then input text into some form
fields

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 01/03/2005 by Hlam
'
ChangeFileOpenDirectory "F:\FIN\Invoice and Authorization Letter\"
Documents.Open FileName:="""Reg Signing.doc""",
ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
Selection.TypeText Text:="test1" ' a tab key to move to
another field not captured in macro??
Selection.TypeText Text:="test2"
Selection.TypeText Text:="test3"
Selection.TypeText Text:="test4"
ActiveDocument.Close
End Sub

But when I tried to run this macro to do exactly the same thing it gives me
the message"
"This method or property is not available because the object refers to a
protected area of the document"

Does it mean text has to be input manually, VBA input is not supported in a
protected document?

This document is created from our headquarter that has no password given to
unprotect.
 
W

Word Heretic

G'day "hlam" <[email protected]>,

Normally you unprotect the document, fill in the values of the
formfields and then protect the document without resetting the fields.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


hlam reckoned:
 

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