S
Sarah_Lecturer
At the moment my macro inserts a field in my form at the bottom of the
form... how do I get it to insert a field at the current insertion point
instead? I would also like the document reprotected with the relevant
password.
Dim oRng As Word.Range
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect Password:="***"
End If
Set oRng = .Range
With oRng
.Collapse wdCollapseEnd
.InsertAfter vbCr
.Move wdCharacter, 1
End With
.FormFields.Add Range:=oRng, Type:=wdFieldFormTextInput
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End With
End Sub
thanks for your help xx
form... how do I get it to insert a field at the current insertion point
instead? I would also like the document reprotected with the relevant
password.
Dim oRng As Word.Range
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect Password:="***"
End If
Set oRng = .Range
With oRng
.Collapse wdCollapseEnd
.InsertAfter vbCr
.Move wdCharacter, 1
End With
.FormFields.Add Range:=oRng, Type:=wdFieldFormTextInput
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End With
End Sub
thanks for your help xx