Bookmark for FormField

M

Mark L

Does anyone know code for assigning a bookmark to a formfield? I can put a
bookmark in, but it always shows up after the formfield, and I want to create
a new formfield and immediately give the bookmark itself a bookmark name. It
must be just one or two lines of code, but I can't find it and it's holding
up my project. Thanks so much for helping out.
 
J

Jay Freedman

On Wed, 4 May 2005 18:51:03 -0700, Mark L <Mark
Does anyone know code for assigning a bookmark to a formfield? I can put a
bookmark in, but it always shows up after the formfield, and I want to create
a new formfield and immediately give the bookmark itself a bookmark name. It
must be just one or two lines of code, but I can't find it and it's holding
up my project. Thanks so much for helping out.

The "bookmark name" you see in the Properties dialog of a formfield
corresponds to the .Name property of the FormField object in VBA.

Dim oFld As FormField
Set oFld = ActiveDocument.FormFields.Add( _
Range:=oRg, Type:=wdFieldFormTextInput)
oFld.Name = "MyFieldName"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top