Hi.
I'm making a script that I want to jump from one formfield to the
next. Below is the code. How do I get this vbs code to jump to the
next FormField?
Set objWord = createobject("word.application")
objWord.visible = True
Set objDoc = objWord.Documents.Add("c:\mydoc.doc", false)
objDoc.FormFields("Text4").Result = "Some text"
objDoc.FormFields("Text4").Next.select
'The next line fails
objDoc.Selection.Result = "Text in the next FormField"
I would strongly suggest that you avoid using the selection at all costs. I
would also suggest that you give meaningful names to the bookmarks assigned
to the formfields,especially if you want to access them via vba.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi.
> I'm making a script that I want to jump from one formfield to the
[quoted text clipped - 9 lines]
> 'The next line fails
> objDoc.Selection.Result = "Text in the next FormField"
Thomas M - 15 Nov 2005 07:37 GMT
>I would strongly suggest that you avoid using the selection at all costs. I
>would also suggest that you give meaningful names to the bookmarks assigned
>to the formfields,especially if you want to access them via vba.
I too prefer specific names for each formfield. However, the company
document that is to be used, does not have all formfields named.
Therefore, I cannot address each formfield. And I'm not allowed to
change the document. This is why I want to jump from field to field.
Regards,
Thomas