Michele Zarri ha scritto:
On 5/29/07, contabilita <[EMAIL PROTECTED]> wrote:
contabilita ha scritto:
> e' possibile attendere la fine di SystemShellExecute prima di
> procedere con la macro dove e' inserito il comando?
> ho dato un'occhiata qui
>
http://api.openoffice.org/docs/common/ref/com/sun/star/system/module-ix.html
>
> ma non ho capito come fare a controllare la fine del comando.
> se qualcuno ha un esempio...
> anticipatamente ringrazio
> Beppe
al momento ho risolto con l'istruzione:
wait 2000
dopo la chiamata di SystemShellExecute
in modo da farlo attendere 2 secondi (che in realta' sono troppi),
avrei preferito che la macro continuasse dopo la chiamata di sistema,
in modo da non dare l'impressione di programma fermo a chi lo usa.
ciao
Beppe
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Ciao,
Anch'io ho lo stesso problema anche se in realta' sono forse piu'
...
"trucco"
ho una macro che mi apre automaticamente in Writer un file archiviato
il cui nome e' un input della macro. Poiche' a volte la macro non
funzionava perche' il file da aprire ancora non esisteva (davo il
comando open prima che l'estrazione fosse terminata) ho "risolto" con
un
do
while fileExists(...)
*non ricordo esattamente se il comando e' davvero fileExists(...) :-)
Ciao,
Michele
grazie, l'idea e' buona, ma il mio file esiste sia prima che dopo la
macro...
infatti rinomino il file con la data + un numero casuale e lo ricreo con
il nome originale.
ciao
Beppe
ho controllato qui a pagina 294
http://www.pitonyak.org/AndrewMacro.pdf
ma non riesco a capire come faccia a sincronizzare la cosa.
poi ho trovato questo documento, vedo se riesco a farlo funzionare...
http://plan-b-for-openoffice.org/ooo-help/en-US/WIN/sbasic/sbasic/sbasic/shared/03130500
Syntax:
Shell (Pathname As String[, Windowstyle As Integer][, Param As String][,
bSync])
Return value:
Long
Parameter:
Pathname: Complete path and program name of the program to start.
Windowstyle: Specifies the style of the window in which the program is
executed.
Param: Any string expression that specifies the command line to be passed.
bSync: If False (the default), an immediate return occurs. If True, then
the Shell statement
does not return until after the program is finished running.
Shell Function [Runtime]
Starts another application and defines the respective window style, if
necessary.
Syntax
Shell (Pathname As String[, Windowstyle As Integer][, Param As String][,
bSync])
Parameter:
Pathname:
Complete path and program name of the program that you want to start.
Windowstyle:
Optional integer expression that specifies the style of the window that
the program is executed in. The following values are possible:
0 The focus is on the hidden program window.
1 The focus is on the program window in standard size.
2 The focus is on the minimized program window.
3 focus is on the maximized program window.
4 Standard size program window, without focus.
6 Minimized program window, focus remains on the active window.
10 Full-screen display.
Param:
Any string expression that specifies the command line that want to pass.
bSync
If this value is set to true, the Shell command and all OpenOffice.org
tasks wait until the shell process completes.
If the value is set to false, the shell returns directly. The default
value is false.
Error Codes
5 Invalid procedure call
53 File not found
73 Feature not implemented
Example
Sub ExampleShellForWin
Shell("c:\windows\calc.exe",2)
end sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]