Monday, March 29, 2010

RefreshDesign of NotesDatabase using NotesAPI

Here is an example how we can do refresh design using NotesAPI.

I'm really interesting in approach without NotesAPI, but did not find any good. If somebody know better approach, please share it :)
 Function RefreshDesign(sourceDb As NotesDatabase, refreshServer As string)  
 Dim destPath As String  
 Dim rc As Integer  
 Dim hDb As Integer  
 If sourceDb.Isopen Then  
 'sourceDb could be local or server  
 If sourceDb.server = "" Then  
 destPath = sourceDb.filePath  
 Else  
 destPath = sourceDb.server & "!!" & sourceDb.filePath  
 End If  
 ' Open the db in the API and get a handle to the open db  
 rc = W32_NSFDbOpen(destPath, hDb)  
 ' Return zero on success, non-zero on failure  
 If rc = 0 Then  
 rc = W32_DesignRefresh(refreshServer, hDb, 0, 0, 0)  
 Call W32_NSFDbClose(hDb)  
 End If  
 End If  
 End Function  

1 comment :

Michael Ruhnau said...

Hi there,

I once used the NotesTemplateSettings Class published in the Sandbox on LDD.

The library can be found here:
http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/8f51788d11d4cec185256929003c9b1d?OpenDocument

which works like a charm. It was published in 2000 but thanks to backwards compatibility it even works with Notes 8.5.1 ;-)

HTH - Michael