6 messages in org.openoffice.fr.prog[prog] simuler uno:Reload
FromSent OnAttachments
Marceau GUIHARDAug 18, 2006 1:20 am 
Laurent GodardAug 18, 2006 1:31 am 
GloopsAug 18, 2006 3:56 am 
Marceau GUIHARDAug 18, 2006 4:00 am 
Francois GattoAug 18, 2006 12:11 pm 
Marceau GUIHARDAug 18, 2006 1:45 pm 
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] simuler uno:ReloadActions...
From:Marceau GUIHARD (marc@wanadoo.fr)
Date:Aug 18, 2006 1:45:40 pm
List:org.openoffice.fr.prog

Merci de ta réponse. Si j'ai bien compris, tu ferme le document sans le sauver et tu le rouvre aussitôt. ça marche, c'est ce que j'ai d'abord fait, mais "uno:reload" lui, ne détruit pas la fenêtre principale pour la recréer ensuite, il ne détruit que les frames contenus dedans, de plus, si il n'y a pas de temps d'attente entre le close (ou le dispose) et le rechargement, il ne se passe plus rien: si je déroule la macro pas à pas, tout se passe bien, si je l'exécute hors EDI, ça ne marche presque jamais. Enfin, puisqu'on ferme le document, il faut que la macro soit dans "Mes Macros" et non dans celles du document, ce qui est évident. Cordialement

Marceau

Francois Gatto a écrit :

Bonsoir,

Marceau GUIHARD a écrit :

Merci pour cette réponse rapide qui me suffit amplement, je cherchais en vain dans l'API un service qui aurait répondu à la question.

Autre question : Y-a t'il moyen de recharger le document en cours en passant par l'API "Component" autrement que par le call dispatch "uno:Reload" ? Cordialement

Marceau

Une idée

sub ReOpenCsv dim oPathSettings as variant dim aPath as string dim aFile as string dim oDoc as object dim aSeparator as string aSeparator = GetPathSeparator() oPathSettings = CreateUnoService( "com.sun.star.util.PathSettings" ) aPath = convertFromUrl( oPathSettings.Work ) if right(aPath,1) <> aSeparator then aPath = aPath & aSeparator aFile = convertToUrl( aPath & "resultats.csv" ) dim fileProperties(1) as new com.sun.star.beans.PropertyValue fileProperties(0).Name = "FilterName" fileProperties(0).Value = "Text - txt - csv (StarCalc)" fileProperties(1).Name = "FilterOptions" fileProperties(1).Value = "59,34,ANSI,1" StarDesktop.loadComponentFromUrl( aFile,"_default",0,fileProperties() ) oDoc = ThisComponent wait 5000 '5 sec. if oDoc.IsModified then msgbox "Attention document modifié",48, "Bye, bye" REM ### prevoir sauvegarde else oDoc.Dispose() StarDesktop.loadComponentFromUrl( aFile,"_default",0,fileProperties() ) end if end sub