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.
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.