View Single Post
 
Old 04-05-2015, 02:59 PM
jer85's Avatar
jer85 jer85 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Mar 2015
Location: Budapest, Hungary
Posts: 2
jer85 is on a distinguished road
Default

Hi! For Problem 1 solution I'd still be grateful, however I've found a solution for Problem 2:

Sub Makró1()

Dim oFF1 As FormField
Dim oFF2 As FormField
Dim oFFx As FormField
Dim sFindText As String

Selection.HomeKey wdStory
sFindText = "f1"
Selection.Find.Execute sFindText
Do Until Selection.Find.Found = False
Set oFF1 = Selection.FormFields.Add(Range:=Selection.Range, Type:=wdFieldFormTextInput)
With oFF1
With .TextInput
.EditType Type:=wdNumberText, Default:="", Format:=""
.Width = 1
End With
.Enabled = True
End With
ActiveDocument.Fields.Update
Selection.Find.Execute
Loop

Selection.HomeKey wdStory
sFindText = "f2"
Selection.Find.Execute sFindText
Do Until Selection.Find.Found = False
Set oFF2 = Selection.FormFields.Add(Range:=Selection.Range, Type:=wdFieldFormTextInput)
With oFF2
With .TextInput
.EditType Type:=wdNumberText, Default:="", Format:=""
.Width = 2
End With
.Enabled = True
End With
ActiveDocument.Fields.Update
Selection.Find.Execute
Loop

Selection.HomeKey wdStory
sFindText = "fx"
Selection.Find.Execute sFindText
Do Until Selection.Find.Found = False
Set oFFx = Selection.FormFields.Add(Range:=Selection.Range, Type:=wdFieldFormTextInput)
With oFFx
With .TextInput
.EditType Type:=wdRegularText, Default:="", Format:=""
End With
.Enabled = True
End With
ActiveDocument.Fields.Update
Selection.Find.Execute
Loop

End Sub
Reply With Quote