terça-feira, 27 de julho de 2010

Renomear o nome da base notes

Dim s As New NotesSession
Dim dbCur As NotesDatabase
Set dbCur = s.CurrentDatabase
Dim sDirectoryPath As String
sDirectoryPath = Left( dbCur.FilePath, Len(dbCur.FilePath) - Len(dbCur.FileName) )




Function rename(dbase As NotesDatabase,newname As String)

'//seta o caminho da base a ser renomeada
fulldbase$ = dbase.FilePath

a = 1
Do
b=a
a = Instr(b+1,fulldbase$, "\")
Loop Until a = 0

fulldbpathwithoutnsf$ = Left$(fulldbase$,b)

'//perdendo o indice da base
Set dbase = Nothing
'//renomeando a base
Name fulldbase$ As fulldbpathwithoutnsf$ + newname + ".nsf"

End Function

Nenhum comentário:

Postar um comentário