Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort by Expression

Hi All,

How do I associate Sort Orders => Sort by Expression to a particular field in a group using a macro.

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

2 Replies
Not applicable
Author

set fld=ActiveDocument.GetField("Salesman")

set fldsrt = fld.GetDefaultSortCriteria

fldsrt.SortByExpression = 1

fldsrt.Expression.v = "sum(Amount)"

fld.SetDefaultSortCriteria fldsrt

Not applicable
Author

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