J
JGM
Hi Con,
Your problem is quite simple, really. Next time, try the step by step
debugging (place the cursor inside the macro in the VBA editor and hit F8)
to get a clue as to why it does not work.
In your case, you now what "jsano" is, but the VBA compiler has no clue...
You have to define it somehow.
As it is
is not an error per se, so the code runs, but the Then part is never
executed... Anyway, I might be wrong as I am no expert, but that's what I
understand from looking at your code.
Play around with the following to get a sense of declaring objects in your
code:
_______________________________________
Dim ff As FormField
For Each ff In ActiveDocument.FormFields
If ff.Name = "jsano" Then
If ff.Result = "" Then
ff.Result = "test"
End If
End If
Next ff
_______________________________________
HTH
Cheers!
Your problem is quite simple, really. Next time, try the step by step
debugging (place the cursor inside the macro in the VBA editor and hit F8)
to get a clue as to why it does not work.
In your case, you now what "jsano" is, but the VBA compiler has no clue...
You have to define it somehow.
As it is
is always false because the compiler does not know what "jsano" is, but itIf jsano = "" Then
is not an error per se, so the code runs, but the Then part is never
executed... Anyway, I might be wrong as I am no expert, but that's what I
understand from looking at your code.
Play around with the following to get a sense of declaring objects in your
code:
_______________________________________
Dim ff As FormField
For Each ff In ActiveDocument.FormFields
If ff.Name = "jsano" Then
If ff.Result = "" Then
ff.Result = "test"
End If
End If
Next ff
_______________________________________
HTH
Cheers!