Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an InputField called Input1. The initial values load off of an Excel file. I'd like to link a button to a macro that will change all the values to zero. Is there a way to code that in a macro? I already know how to make them revert to the original values, but how can I force a specific value on them?
Maybe I don't fully understand your goal, but it sounds like it would be easier to use a trigger to set the variable to zero on opening. Have you tried that?
Hi danielact,
You can use the SetInputFieldCell or SetInputFieldValue to change the inputfield values.
example:
set fld = ActiveDocument.Fields("Budget")
fld.SetInputFieldValue 0, "999"
set obj = ActiveDocument.GetSheetObject("TB01")
obj.SetInputFieldCell 1,1,"999" 'set 2nd row value in 2nd column to 999
See the Api Guide for more details. Hope this helps you.
Regards
hi
try this in macro,
document-->trigger-->on post reload
sub resetinput
dim x(1)
x(0) = 0
set fld = ActiveDocument.Fields("newprice")
fld.ResetInputFieldValues 0, x
end sub