Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to loop and create variables.
How is the syntax for adding the loop number to variable names:
My macro:
sub varset v = ActiveDocument.Variables("vCountrows").GetContent.Stringfor i = 0 to vActiveDocument.Fields("Vtif2").select(v)ActiveDocument.CreateVariable "vIntime"ActiveDocument.Variables("vIntime").SETCONTENT ActiveDocument.Fields("intime").GetPossibleValues.item(0).text,TRUEActiveDocument.CreateVariable "vOuttime"ActiveDocument.Variables("vOuttime").SETCONTENT ActiveDocument.Fields("outtime").GetPossibleValues.item(0).text,TRUEActiveDocument.CreateVariable "vDep"ActiveDocument.Variables("vDep").SETCONTENT ActiveDocument.Fields("depatment").GetPossibleValues.item(0).text,TRUEnextend sub
My wish is to add the number from the loop to the variable name: after först round it should be vIntime1, vOuttime1 and vDep1
How can I add this to the macro?
Liivi