Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How do I associate Sort Orders => Sort by Expression to a particular field in a group using a macro.
Thanks in advance
Hi Miller,
Thanks for your reply. I found a way to achive this.
groups = ActiveDocument.GetGroups
set gp = groups(0).GetProperties
set sc = gp.SortCriterias
sc(0).SortByExpression = 1
sc(0).Expression.v = "sum(Amount)"
groups(0).SetProperties gp
set fld=ActiveDocument.GetField("Salesman")
set fldsrt = fld.GetDefaultSortCriteria
fldsrt.SortByExpression = 1
fldsrt.Expression.v = "sum(Amount)"
fld.SetDefaultSortCriteria fldsrt
Hi Miller,
Thanks for your reply. I found a way to achive this.
groups = ActiveDocument.GetGroups
set gp = groups(0).GetProperties
set sc = gp.SortCriterias
sc(0).SortByExpression = 1
sc(0).Expression.v = "sum(Amount)"
groups(0).SetProperties gp