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