Hello everybody!
I have a problem using FormFields in macros, and I am not sure whether I have found a bug or am just too stupid to programme the thing properly…
In my document I have a FormField named “TxtTarget”. I want to write some text in this field by using a macro. Therefore I use the following line:
ActiveDocument.FormFields(“TxtTarget”).Result = “Here comes the text.”
This works as expected, at least as long as the text has less than 256 characters. If this length is exceeded, I receive an error message (Runtime Error ‘4609’, String too long). The funny thing is, that there is no defined restriction in the FormField (no limitation for string length set). Also it is possible to write longer text in the FormField directly. The Result-Property contains the elongated string as well. Only it seems not to be possible to convince Word to set the property to a longer string via macro.
Does anyone have an idea about this? Or a workaround?
Any help will be appreciated!
Many greetings, Porley