Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i want to create a macro which changes the value of two variables depending on the state of 9 fields, of which 7 have an '=0' condition and the other two need to bechecked fr some specific value in the field.
When i did this it states error.
if ActiveDocument.Evaluate("GetSelectedCount(Field1)")=0 and
ActiveDocument.Evaluate("GetSelectedCount(Field2)")=0 and
ActiveDocument.Evaluate("GetSelectedCount(Field3)")=0 and
ActiveDocument.Evaluate("GetSelectedCount(Field4)")=0 and
ActiveDocument.Evaluate("GetSelectedCount(Field5)")=0 and
ActiveDocument.Evaluate("GetSelectedCount(Field6)")=0 and
ActiveDocument.Evaluate("GetSelectedCount(Field7)")=0 and
ActiveDocument.Evaluate("GetFieldSelections(PG)='Overall'") and
ActiveDocument.Evaluate("GetFieldSelections(LCC_GDS)='Overall'") then
ActiveDocument.Variables("vShow").SetContent 1,True
ActiveDocument.Variables("vShow2").SetContent 0,True
else
ActiveDocument.Variables("vShow").SetContent 0,True
ActiveDocument.Variables("vShow2").SetContent 1,True
end if
End Sub
what need to be changed here?????
Hello,
If you're getting a "syntax error", try adding an underscore " _" after the "and" in your if statement.
Just to link all lines together as one statement.
Hello,
If you're getting a "syntax error", try adding an underscore " _" after the "and" in your if statement.
Just to link all lines together as one statement.