M
Murali
I have created a simple form field like this:
Name (Style - 'TemplateLabel' ) : {FormField} (Style = 'Title1')
The style of form field ('Title1') is available when the document is in
UnProtected Mode. The Problem is the Style of formfield gets changed to
'TemplateLabel' on changing the document to Protected Mode.
Following is the code is invoked dynamically on click of a Command Button:
Private Sub GalleryImages_Click()
ActiveDocument.Unprotect Password:=""
Selection.TypeText Text:="Title" & vbTab & vbTab
Selection.Style = ActiveDocument.Styles("TemplateLabel")
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
With Selection.FormFields(1)
.Name = "Title1"
End With
Selection.Style = ActiveDocument.Styles("Title1")
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True
End Sub
Can anybody help to let know why the formfield style gets changed on
Protecting the document?
Thanks for your help
Murali
Name (Style - 'TemplateLabel' ) : {FormField} (Style = 'Title1')
The style of form field ('Title1') is available when the document is in
UnProtected Mode. The Problem is the Style of formfield gets changed to
'TemplateLabel' on changing the document to Protected Mode.
Following is the code is invoked dynamically on click of a Command Button:
Private Sub GalleryImages_Click()
ActiveDocument.Unprotect Password:=""
Selection.TypeText Text:="Title" & vbTab & vbTab
Selection.Style = ActiveDocument.Styles("TemplateLabel")
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
With Selection.FormFields(1)
.Name = "Title1"
End With
Selection.Style = ActiveDocument.Styles("Title1")
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True
End Sub
Can anybody help to let know why the formfield style gets changed on
Protecting the document?
Thanks for your help
Murali