Sum af 2 felter
Jeg har nu prøvet igennem noget tid at plusse 2 formfields og skrevet det ud i en tredje men har åbentbart store problemer med det... FormFields.Result virker ikke... det er en macro som kører hver gang man forlader felt nummer 2Sub addAB()
If ActiveDocument.ProtectionType <> wdNoProtection Then
ReProtectionType = ActiveDocument.ProtectionType 'get the type of Protection
ReProtectDoc = True 'set a flag so we know we need to reapply the Protection
ActiveDocument.Unprotect ("pwd") 'unprotect the document
End If
Set MyRangeA = ActiveDocument.FormFields("a").Result
Set MyRangeB = ActiveDocument.FormFields("b").Result
ActiveDocument.FormFields("c").Result = (MyRangeA * MyRangeB)
If ReProtectDoc = True Then
ActiveDocument.Protect ReProtectionType 'Replace the protection Level
ReProtectDoc = False 'reset the flag
End If
End Sub
Nogle der har et svar på dette?