Design Replace with Hide Formulas and LS programmaticaly?

Hi all,

is there a way to replace the design of a db, and hide the formlas and script of it programmatically ?

I didn´t find anything in script nor in C API documentation.

Thanks in advance,

Julian

Subject: Design Replace with Hide Formulas and LS programmaticaly ?

found something here :

http://blogs.teamstudio.com/blog/blog.nsf/d6plinks/CSCN-6KUQZC

I found an interesting function recently while trying to find a way to easily hide the design of a database: NSFHideDesign. For 3rd party developers like a lot of you out there (Teamstudio included), hiding the design of a database is pretty important. Not just for protecting your work from people who would like to steal from it, but sometimes protecting them from themselves. Support calls due to someone mucking around in design they no nothing about can generate support issues that are sometimes tricky to identify. However, the process can be very cumbersome, especially if you are trying to hide the design of a template…

Turns out there is an undocumented export in nnotes.dll that will hide the design of a database. This function, ‘NSFHideDesign’ takes 4 parameters. The first 2 are handles to databases, the second 2 are Long’s. By passing the same handle for the first 2 parameters I was able to hide the design of my test template. I’m pretty sure that one parameter is the source template, and the other is the target database, but I’m not really sure. If anyone finds out more, please let me know!

PLEASE NOTE: I have only explored this function enough to satisfy my project requirements using Notes 6.5.3. For me, the following code was enough, but it may not be for you. Also, as with all undocumented functions, everything here is subject to change at anytime without notice. IBM is under no obligation to support this function or it’s current behavior. Don’t be surprised if one day it suddenly stops working or does something completely unexpected.

Declare Function NSFHideDesign Lib “nnotes.dll” ( Byval hdb1 As Long, Byval hdb2 As Long, Byval Unk1 As Long, Byval Unk2 As Long ) As Integer

Declare Function NSFDbOpen Lib “nnotes.dll” (Byval pszPath As Lmbcs String, phdb As Long ) As Integer

Declare Function NSFDbClose Lib “nnotes.dll” ( Byval hdb As Long ) As Integer

Sub Click(Source As Button)

  'open the database

  Dim hdb As Long

  Dim status As Integer

 

  status = NSFDbOpen( "testdatabase.nsf", hdb )

  If 0 <> status Then

          Print "Error"

          Exit Sub

  End If

 

  status = NSFHideDesign( hdb, hdb, 0, 0 )

  If 0 <> status Then

          Print "Error"

  End If

 

  NSFDbClose hdb

End Sub

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ît passed my first test 100%…

i´ll keep looking for side effects