1 message in org.openoffice.fr.prog[prog] Explication Fonction addProperty
FromSent OnAttachments
SOMMIER ArnaudNov 21, 2005 12:38 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] Explication Fonction addPropertyActions...
From:SOMMIER Arnaud (arna@eic.fr)
Date:Nov 21, 2005 12:38:32 am
List:org.openoffice.fr.prog

Bonjour,

J'essaye de comprendre et d'adapter le code qui provient d'ici : http://codesnippets.services.openoffice.org/Office/Office.ContexMenuInte rceptor.snip

Mais je bloque un peu.. Un des menu est ajouter par la ligne :

oMenuItem = GetSimpleMenuItem("Entry3", "Run the Snippet Creator", "macro:///SnippetCreator.Main.Main") oATContainer.insertByIndex(2, oMenuItem)

Et la fonction GetSimpleMenuItem est la suivante :

Function GetSimpleMenuItem( sName As String, sText As String, _ sCommandUrl As String, Optional sHelpUrl As String ) As Object

Dim oPropSet As Object Dim sInternalName As String

sInternalName = MNU_PREFIX & sName If oPropSetRegistry.hasByName(sInternalName) Then oPropSetRegistry.removePropertySet(sInternalName) End If

oPropSet = oPropSetRegistry.openPropertySet(sInternalName, True)

oPropSet.addProperty("Text", 0, sText) oPropSet.addProperty("CommandURL", 0, sCommandUrl)

If Not IsMissing(sHelpUrl) Then oPropSet.addProperty("HelpURL", 0, sHelpUrl) End If

GetSimpleMenuItem = oPropSet

End Function

Ce que je ne comprend pas c'est comment fonctionne la fonction addProperty qui ajoute la CommandURL. A quoi correspond cette Command URL ?? À la macro à lancer par ce menu ?? Car j'ai essayé de changer le paramètre "macro:///SnippetCreator.Main.Main" mais pour l'instant sans succés :( Si quelqu'un a des renseignements sur le sujet Merci d'avance.