怎样对一个文档的所有文档按某个域的值排序?55555555555555555

yjlztx95 2003-08-29 09:15:37
Dim dc as notesdocumentcollection
dim rsdoc as notesdocument
Set dc=Mdoc.responses
If dc.count>0 then
For i=1 to dc.count
set rsdoc=dc.getNthdocument(i)
print rsdoc.域(0)
next
end if
这样找出来的值是按创建日期的先后顺序排序。怎么办?
...全文
38 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yjlztx95 2003-08-30
  • 打赏
  • 举报
回复
试一下
waffie 2003-08-29
  • 打赏
  • 举报
回复
子函数:
Sub OrderDc(dc As notesdocumentcollection,order() As Integer)
total=dc.count
If total=1 Then
Redim order(1)
order(1)=1
Exit Sub
End If
Dim k As Integer
Dim kk As Integer
Dim tempdoc As notesdocument
Dim banhao() As String
Redim order(1 To total) As Integer
Redim bianhao(1 To total) As String
For k=1 To total
Set tempdoc=dc.getnthdocument(k)
If tempdoc.form(0)="yjjg" Or tempdoc.form(0)="ejjg" Or tempdoc.form(0)="sjjg" Or tempdoc.form(0)="SIjjg" Then
If tempdoc.danweibianma(0)="" Or Len(tempdoc.danweibianma(0))<>9 Then
bianhao(k)=99999999
Else
bianhao(k)=tempdoc.danweibianma(0)
End If
Else
bianhao(k)=tempdoc.renyuanbianhao(0)
End If
order(k)=k
Next
For k=1 To total-1
For kk=k+1 To total
If Trim(bianhao(k))>Trim(bianhao(kk)) Then
temp=bianhao(k)
bianhao(k)=bianhao(kk)
bianhao(kk)=temp
temp1=order(k)
order(k)=order(kk)
order(kk)=temp1
End If
Next
Next
End Sub

主函数中的调用:

dim rsdoc as notesdocument
dim dc as notesdocumentcollection
dim rsdoc as notesdocument
Set dc=Mdoc.responses
If dc.count>0 Then
Dim order() As Integer
Call OrderDc(dc,order())
For j= 1 To dc.count
Set rsdoc=dc.getnthdocument(order(j))
//your code
.......
next
end if
ntko 2003-08-29
  • 打赏
  • 举报
回复
在视图中显示域值的列排序。
klbt 2003-08-29
  • 打赏
  • 举报
回复
帮你顶。

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧