Adding new icon to toolbar with script

From LDD(http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/d2afd020da55b8e985256e4c002850c7?OpenDocument&Highlight=0,bookmark,bar)
My goal is to distribute the news entry with a button that I will send to my users.

1. The first part of the button copy the outline in the outline "UserToolBar" of the local "bookmark.nsf". This add the tool bar with the actions.

2. To import the gif I have created a public network share on which I have put the DXL exportation of my image. Then I import this file in the bookmark.nsf. (be careful of the version of the DTD used in your designer client and the one available in the target client... it should be the same)

The solution isn't smart but it works... I will improve it with time.

-----------------------------

Sub Click(Source As Button)
'------------------------------------------------------------------------------------------------------------
' Function.....: Code permettant de déployer l'outline des dictionnaires dans un bookmark.nsf local
' Date...........: 02.03.2004
' Author........: Pierre Koerber
' Desc..........:
' Return........: Rien
'------------------------------------------------------------------------------------------------------------
Dim dbBook As NotesDatabase
Dim thisDatabase As notesdatabase
Dim db As notesdatabase
Dim se As New notessession

' --- From where Am I ?
Set thisDatabase = se.CurrentDatabase

' --- Get the local bookmark database
Set db = se.getDatabase("","bookmark.nsf")
If db Is Nothing Then
Msgbox "Impossible to locate... local bookmark "
Exit Sub
End If

' -- Importation des images, stockées sous forme DXL dans un share.
Call importDXL("//frorg06s/notes6/dxl/image.dxl", db)
Print "Images importées.... "

' --- Get the template database
Set dbBook = se.GetDatabase(thisDatabase.server,"Informatique/lotus/orgCommonDesign.nsf")
If dbBook Is Nothing Then
Msgbox "Impossible to locate... source bookmark "
Exit Sub
End If

' -- Get the source outline
Dim outlineSource As NotesOutline
Dim outlineEntrySource As NotesOutlineEntry

' -- This is the source outline
Set outlineSource = dbBook.GetOutline("OrgamolDictionnaireToolBar")

If outlineSource Is Nothing Then
Msgbox "OrgamolDictionnaireTool bar not found !"
Exit Sub
End If

Dim outlineDest As NotesOutline
Dim outlineEntryDest As NotesOutlineEntry

' -- Get the userToolbar outline
Set outlineDest = db.getoutline("UserToolbar")
' -- Get the first entry of the source
Set outlineEntrySource = outlinesource.GetFirst()

' -- Check if it exists.

' --- Create each entries in the dest.
While Not(outlineEntrySource Is Nothing)
Set outlineEntryDest = outlineDest.CreateEntryFrom(outlineEntrySource)
Set outlineEntrySource = outlineSource.GetNext(outlineEntrySource )
Wend

' --- Save the outline
Call outlineDest.save()
Print "Toolbar importée.... "
End Sub

Function importDXL(szFileName As String, pDb As notesdatabase)
'------------------------------------------------------------------------------------------------------------
' Function.....: Fonction ouvrant un fichier DXL et important ce flux en tant que code dans la base courrante.
' Date...........: 02.03.2004
' Author........: Pierre Koerber
' Desc..........:
' Return........: Rien
'------------------------------------------------------------------------------------------------------------
Dim db As notesdatabase
Dim session As New NotesSession

If pDb Is Nothing Then
Set db = session.currentdatabase
Else
Set db = pDb
End If

REM Open dxl file named after current database
Dim stream As NotesStream
Set stream = session.CreateStream
If Not stream.Open(szFileName) Then
Messagebox "Cannot open " & szFileName,, "Error"
Exit Function
End If
If stream.Bytes = 0 Then
Messagebox "File did not exist or was empty",, szFileName
Exit Function
End If

REM Create new database named current database + "Copy"

REM Import DXL into new database
Dim importer As NotesDXLImporter
Set importer = session.CreateDXLImporter(stream, db)
importer.ReplaceDBProperties = True
importer.ReplicaRequiredForReplaceOrUpdate = False
importer.ACLImportOption = DXLIMPORTOPTION_REPLACE_ELSE_IGNORE
importer.DesignImportOption = DXLIMPORTOPTION_CREATE
Call importer.Process

End Function
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值