A
Arthi
Hi ,
I need to create a .dot file , which will have a button. On click of the
button , a label is displayed and a form field is created. The Style (styles
and Formating) of the Label is of character type and the formfield is of
paragraph style .
Name ..............(FormField)
Address .............(Form Field)
the style of the label Name is (Label)
the style of the form field ll be (Name)
Now i am able to create the label and form field
But the style of the form field is not gettin set(which is very
important)... Please Help Me....
Selection.TypeText Text:="Name" & vbTab & vbTab & vbTab & vbTab & vbTab & _
vbTab
Set oRange = Selection.Range
Set oFormField = ActiveDocument.FormFields.Add(Range:=oRange,
Type:=wdFieldFormTextInput)
sName = "Name"
sStyle = "NameStyle"
With oFormField
.Name = sName
.Select
Selection.Style = ActiveDocument.Styles(sStyle)
End With
the style sStyle is created by going to
Format ->styles and Formattin ->NewStyle
Name = Name , Style Type -> Paragraph , style based on ->normal
..Select
Selection.Style = ActiveDocument.Styles(sStyle)
this is used to set the style of the formfield , which i assume is not
working..
I need to create a .dot file , which will have a button. On click of the
button , a label is displayed and a form field is created. The Style (styles
and Formating) of the Label is of character type and the formfield is of
paragraph style .
Name ..............(FormField)
Address .............(Form Field)
the style of the label Name is (Label)
the style of the form field ll be (Name)
Now i am able to create the label and form field
But the style of the form field is not gettin set(which is very
important)... Please Help Me....
Selection.TypeText Text:="Name" & vbTab & vbTab & vbTab & vbTab & vbTab & _
vbTab
Set oRange = Selection.Range
Set oFormField = ActiveDocument.FormFields.Add(Range:=oRange,
Type:=wdFieldFormTextInput)
sName = "Name"
sStyle = "NameStyle"
With oFormField
.Name = sName
.Select
Selection.Style = ActiveDocument.Styles(sStyle)
End With
the style sStyle is created by going to
Format ->styles and Formattin ->NewStyle
Name = Name , Style Type -> Paragraph , style based on ->normal
..Select
Selection.Style = ActiveDocument.Styles(sStyle)
this is used to set the style of the formfield , which i assume is not
working..