Anthony904
IS-IT--Management
My post
was posted in VB section..
Could anyone help me with this..
THanks!
was posted in VB section..
Could anyone help me with this..
THanks!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub makeFFNumeric()
Dim aDoc As Document
Dim i As Integer
Dim aFF As FormField
i = 1
For Each aFF In aDoc.FormFields
With aFF
.Name = "Text" & i
.Enabled = True
.CalculateOnExit = True
With .TextInput
.EditType Type:=wdNumberText, _
Default:="", Format:="0.00"
.Width = 0
End With
End With
i = i + 1
Next
Set aDoc = Nothing
End Sub
Sub MakeASumField()
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty
Selection.InsertFormula Formula:="=Text1 + Text2"
End Sub
ActiveDocument.Fields.Update
ActiveDocument.FormFields("Text3").Result = ActiveDocument.FormFields("Text1").Result + ActiveDocument.FormFields("Text2").Result
Sub MakeASumField()
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty
Selection.InsertFormula Formula:="=Text2 + Text6"
End Sub
ActiveDocument.FormFields("Text3").Result = ActiveDocument.FormFields("Text1").Result + ActiveDocument.FormFields("Text2").Result
ActiveDocument.FormFields("Text3").Result = [red]CDbl([/red]ActiveDocument.FormFields("Text1").Result[red])[/red] + [red]CDbl([/red]ActiveDocument.FormFields("Text2").Result[red])[/red]
Selection.Fields.[COLOR=red]Add[/color red] Range:=Selection.Range, _
Type:=wd[COLOR=red]FieldEmpty[/color red]
Selection.InsertFormula Formula:="=Text2 + Text6"
Sub cmdCalc_Click()
Dim aDoc As Document
Set aDoc = ActiveDocument
aDoc.FormFields("Text30").Result = _
CInt(aDoc.FormFields("Text2").Result) + _
CInt(aDoc.FormFields("Text30").Result)
Set aDoc = Nothing
End Sub