壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1921|回复: 4

请教

[复制链接]
发表于 2004/3/17 13:09:37 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
如何获取未读邮件数量?
发表于 2004/3/17 13:43:56 | 显示全部楼层
Declare Sub W32_OSLoadString Lib "nnotes.dll" Alias "OSLoadString" (Byval null1 As Long, Byval sError As Integer, Byval errstr As String, Byval lenstr As Integer)
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As Lmbcs String, hdb As Long ) As Integer
Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval hdb As Long ) As Integer
Declare Sub W32_OSPathNetConstruct Lib "nnotes.dll" Alias "OSPathNetConstruct" (Byval portName As Lmbcs String, Byval ServerName As Lmbcs String, Byval FileName As Lmbcs String, Byval retPathName As Lmbcs String)
Declare Function W32_NSFDbGetUnreadNoteTable Lib "nnotes" Alias "NSFDbGetUnreadNoteTable" (_
Byval hDB As Long, Byval UserName As String, Byval UserNameLength As Integer, Byval fCreateIfNotAvailable As Integer, _
rethUnreadList As Long) As Integer
Declare Function W32_NSFDbUpdateUnread Lib "nnotes" Alias "NSFDbUpdateUnread"(Byval hDataDB As Long, Byval hUnreadList As Long) As Integer
Declare Function W32_IDEntries Lib "nnotes" Alias "IDEntries" (Byval hTable As Long) As Long

Sub Initialize
        Dim ndb As New NotesDatabase("","")
        Dim s As New NotesSession
        Dim hdb As Long ' db handle (integer for Mac, AIX, SUN Solaris and AS400)
        Dim irc As Integer ' return status
        Dim rethUnreadList As Long ' ID table handle
       
        Call ndb.openMail
        hDb = openDb(ndb)
        If hDB=0 Then
                Print "failed to open mail"
        Else
                IRC% = W32_NSFDbGetUnreadNoteTable (hDB , s.username, Len(s.username) , 1, rethUnreadList)
                If irc%<>0 Then
                        Print getError(irc%)
                Else
                        W32_NSFDbUpdateUnread hDb, rethUnreadList
                        Print s.username, "mailfile contains", W32_IDEntries (rethUnreadList),"unread document(s)"
                End If
                w32_NSFDBClose hdb
        End If
End Sub

Function openDb(ndb As NotesDatabase) As Long
&#39; return db handle
        Dim retPath As String*1024, h As Long
        Dim irc As Integer
       
        W32_OSPathNetConstruct "",ndb.server, ndb.filepath, retPath
        irc% = W32_NSFDbOpen (retPath, h)
        If irc%<>0 Then
                Print getError(irc%)
        End If
        openDb = h
End Function

Function getError (enum As Integer) As String
        Dim s As String*256
        W32_OSLoadString 0, enum And &h07FFFFFFF, s, 256
        getError = Strleft(s, Chr(0))
End Function
发表于 2004/3/17 13:55:42 | 显示全部楼层
/同意
发表于 2004/3/17 14:09:44 | 显示全部楼层
怎么是鸟语?
 楼主| 发表于 2004/3/18 11:40:35 | 显示全部楼层
非常感谢,请问执行此段程序的权限

[本贴已被 lotus_whiz 于 2004-3-18 11:50:45 修改过]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 02:22 , Processed in 0.020628 second(s), 16 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表