使用LotusScript删除私有文件夹

'DECLARATIONS
Const APIModule = "NNOTES"
' Windows/32 only
Const NOTE_CLASS_VIEW= &H0008
Declare Function OSPathNetConstruct Lib APIModule Alias "OSPathNetConstruct" ( Byval NullPort As Long, Byval Server As String, Byval FIle As String, Byval PathNet As String) As Integer

Declare Function NSFDbOpen Lib APIModule Alias "NSFDbOpen" ( Byval PathName As String, DbHandle As Long) As Integer
Declare Function NSFDbClose Lib APIModule Alias "NSFDbClose" ( Byval DbHandle As Long) As Integer
Declare Function NIFFindPrivateDesignNote Lib APIModule Alias "NIFFindPrivateDesignNote" ( Byval hdb As Long, Byval NoteName As String, Byval NoteClass As Integer, NoteID As Long ) As Integer

 

 

Sub DeletePrivateView(db As NotesDatabase, vname As String)
' To open a Domino database on a server, use this function to create
' the full path specification, and pass this specification as input to NSFDbOpen
' or NSFDbOpenExtended.
p$ = String(1024, " ")
OSPathNetConstruct 0, db.Server, db.FilePath, p$
' This function takes a pathname to an existing Domino database or database
' template (whether on a Lotus Domino Server or a local database), opens the
' database, and returns a handle to it. All subsequent access to the database is
' carried out via this handle. Use NSFDbClose to close the database file handle
' and deallocate the memory associated with it.
Dim hDB As Long
NSFDbOpen p$, hDB
' Given the name and NOTE_CLASS_xxx of a private design note (form, view,
' folder, helpindex, macro, field, or replication formula ), this function returns the note ID.
' Uses the View or Folder name passed to it - vname.
Dim retNoteID As Long
Dim result As Integer
result = NIFFindPrivateDesignNote(hDB, vname, NOTE_CLASS_VIEW, retNoteID)
'If result is anything other than 0, the Private Design Note could not be found
If result = 0 Then
Dim doc As NotesDocument
' Get the Private View or Folder by its NoteID
Set doc = db.GetDocumentByID( Hex$(retNoteID) )
Call doc.Remove( True )
Print "Removing : " & vname
End If
' This function closes a previously opened database.
NSFDbClose hDB
End Sub

 

 

测试:

Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase

Set db = s.CurrentDatabase

' Pass the name of the Private View or Folder to delete
Call DeletePrivateView(db, "CustomQuery")
End Sub

转载于:https://www.cnblogs.com/blackbean/archive/2012/06/07/2539810.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值