Z
zxcv
Hi,
I have a form with several text formfields. I'm trying to format the
contents of certain formfields based on user input of other formfields. For
example, if a user enters the number "1" in Text1, I may want the contents of
another formfield, say Text2, to be formatted as bold. My code is as follows:
If doc.FormFields("Text1").Result = 1 Then
doc.FormFields("Text2").Select
Selection.Font.Bold = True
End If
The funny thing is, the code works when I trigger it from within Text1 as a
"run macro on exit". But if I try to run the macro by assigning it to a QAT
button, I get the following error:
Run-time error '4605':
This method or property is not available because the object refers to a
protected area of the document.
I'm confused by this error message because the selected object is a
formfield, which is *not* a protected area of the document. I'm further
confused because, as I said before, the code works as an "run on exit" macro.
I'd appreciate it if anyone could shed some light on this for me.
Jack
I have a form with several text formfields. I'm trying to format the
contents of certain formfields based on user input of other formfields. For
example, if a user enters the number "1" in Text1, I may want the contents of
another formfield, say Text2, to be formatted as bold. My code is as follows:
If doc.FormFields("Text1").Result = 1 Then
doc.FormFields("Text2").Select
Selection.Font.Bold = True
End If
The funny thing is, the code works when I trigger it from within Text1 as a
"run macro on exit". But if I try to run the macro by assigning it to a QAT
button, I get the following error:
Run-time error '4605':
This method or property is not available because the object refers to a
protected area of the document.
I'm confused by this error message because the selected object is a
formfield, which is *not* a protected area of the document. I'm further
confused because, as I said before, the code works as an "run on exit" macro.
I'd appreciate it if anyone could shed some light on this for me.
Jack