Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
Need Macro to insert text form field and protect
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="JFREE223, post: 5891232"] Graham Mayor stated that the logic below would insert an intitial field at the place of the cursor. Is there a way to remove the intitial cursor field entry using the logic below???? Sub WageProtect() ' ' WageProtect Macro ' ' If document is protected, Unprotect it. If ActiveDocument.ProtectionType <> wdNoProtection Then ActiveDocument.Unprotect Password:="fixstyles" End If ' Insert a Field ActiveDocument.FormFields.Add _ Range:=Selection.Range, _ Type:=wdFieldFormTextInput With Selection.Find Do While .Execute(findText:="___________", _ Wrap:=wdFindContinue) Set oRng = Selection.Range oRng.FormFields.Add Range:=oRng, _ Type:=wdFieldFormTextInput Loop End With ' Insert a Field ActiveDocument.FormFields.Add _ Range:=Selection.Range, _ Type:=wdFieldFormTextInput With Selection.Find Do While .Execute(findText:="_______-__-_____", _ Wrap:=wdFindContinue) Set oRng = Selection.Range oRng.FormFields.Add Range:=oRng, _ Type:=wdFieldFormTextInput Loop End With ' ReProtect the document. If ActiveDocument.ProtectionType = wdNoProtection Then ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _ Password:="fixstyles", NoReset:=True End If End Sub [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
Need Macro to insert text form field and protect
Top