Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-07-2016, 06:14 PM
Guessed's Avatar
Guessed Guessed is online now VBA Code to Insert Legacy Text Field Windows 10 VBA Code to Insert Legacy Text Field Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this.
Code:
Sub test()
  Selection.EndKey Unit:=wdLine
  Selection.TypeParagraph
  Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormTextInput
  Selection.Font.Bold = True
  Selection.MoveRight Unit:=wdCharacter, Count:=1
  Selection.TypeText Text:=":"
  Selection.Font.Bold = False
  Selection.TypeText Text:="  "     'this is where the spaces were added
  Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormTextInput
  Selection.HomeKey Unit:=wdLine
  Dim aFld As FormField
  For Each aFld In Selection.Paragraphs(1).Range.FormFields
    aFld.TextInput.EditType Type:=wdRegularText, Default:="", Format:="First capital"
  Next aFld
  Do While Selection.Paragraphs(1).Range.Bookmarks.Count > 0
    Selection.Paragraphs(1).Range.Bookmarks(1).Delete
  Loop
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code to Insert Legacy Text Field Insert text form field help sj80 Word 1 01-26-2016 10:50 PM
VBA Code to Insert Legacy Text Field Variable text field code based on occurrences on each page Cosmo Word 2 12-29-2015 11:54 AM
VBA Code to Insert Legacy Text Field Grammar check into legacy forms > Text form field. Eduardo Care Word 2 09-09-2015 03:11 PM
VBA Code to Insert Legacy Text Field legacy Form Field sunrise06 Word 9 05-02-2015 06:48 PM
Filling in legacy field causes rest of line to move to next tab stop rtrdom Word 5 12-14-2013 05:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft