Is it Notes mathod?->"Call db.ArchiveNow(coll)"

Hello, When we do archive using “Archive\select Document”, the coding will be run below, my question is

“Call db.ArchiveNow(coll)”, I don’t know about the “ArchiveNow(coll)”, where can I find the coding if it is not Notes method? Because running stoped here and a error message appears told me I don’t have access to do archive, but I checked the ACL, I have designed access, and it works fine before the administor changed ACL.

Thanks a lot in advance.

Linda

Sub Initialize

On Error Goto Trap	

Dim s As New notessession

Dim uiws As New notesuiworkspace	

Dim db As notesdatabase

Dim coll As notesdocumentcollection

Dim StringTable As New mailtoolsstringtable			



Set db = s.currentdatabase

Set coll = db.unprocesseddocuments



If YesNoPrompt(StringTable.GetString(TOOL_STRING+76,coll.count),StringTable.GetString(TOOL_STRING+75,Null)) Then		

Archive:

	Call db.ArchiveNow(coll)		

	Call uiws.Viewrefresh()

End If		

Exit Sub

Trap:

If YesNoPrompt(Error$ & Chr(10) & StringTable.GetString(TOOL_STRING+74,Null),StringTable.GetString(TOOL_STRING+75,Null)) Then

	If uiws.Currentdatabase.Editarchivesettings() Then

		Resume Archive

	Else

		End

	End If

End If

End Sub

Subject: Is it Notes mathod?->“Call db.ArchiveNow(coll)”

ArchiveNow is not a method of the NotesDatabase class (that I’m aware of anyway, unless it is undocumented). Archiving in the mail database is performed through an agent. So, if you want to run archiving and have the same design elements in place as are used in the mail template, you can do:

Dim agt as NotesAgent

Set agt = db.GetAgent(“Archive\Archive Now”)

agt.Run

Subject: RE: Is it Notes mathod?->“Call db.ArchiveNow(coll)”

Hi Cesar,

Nice to "see"you. ^-^.

My problem is we copied the agents ans LotusScript on our own database to do archive. They are works fine before. Until recently, the administor seems changed ACL of each database, so we got error message for some people, even if I have designer access, I can not doing archive anymore now. (before I can do it).

The administor has no idea about that.

I just wanted to try why I got no access error message? where and how the “Archive” checked the access, so I can change it and make the function working properly.

Thanks,

Linda

Subject: RE: Is it Notes mathod?->“Call db.ArchiveNow(coll)”

Well, looking at the mail template, it appears that ArchiveNow is indeed an undocumented method of the NotesDatabase class but one that has changed between versions. In fact, the R7 archiving agent (presumably the one you should be using, given that you indicated Release 7.0.2) does the following:

==================================

If s.Notesbuildversion < 167 Then

	Goto ArchivePreRnext

End If

==================================

and then

==================================

	policy = dlgNote.GetItemValue("tmpPolicySelected")(0)

	Call db.archiveNow( collection, policy )

	Call uiws.Viewrefresh()

==================================

while this code is used for pre RNext clients:

==================================

	Call db.archiveNow( collection )

	Call uiws.Viewrefresh()

==================================

Also note that the error trapping code in this agent checks specifically for error 184 to determine if archiving is prohibited, something that your current code does not do:

==================================

On Error Resume Next

Dim sterr As String

If Err = 184 Then

	sterr= Msgbox (ArcProhibit, MB_OK+MB_ICONEXCLAMATION,ArcTitle)

Else

	Call DisplayWarn(needsSetup & Error$ & Chr(10),MB_OK,StringTable.GetString(TOOL_STRING+75,Null))

End If

Exit Sub

==================================

Subject: RE: Is it Notes mathod?->“Call db.ArchiveNow(coll)”

Hi Cesar, You are right.

I tried to log on different PC (R6), Everything works fine. No more error message. So that is the version problem. I don’t want to change the coding as clients all use R6.

Thank you very much for your help. ^-^

Linda