#contents *システムコマンドの実行 [#d4b9ee60] OOo Basic ではランタイム関数の Shell を使用してアプリケーションの起動ができます。コマンドに引数を与えにくかったりします。 OOo API からでも実行が可能です。ここではサービスを利用して実行する方法を説明します。Shell に関しては OOo のヘルプを参照。 com.sun.star.system.SystemShellExecute サービスを利用します。 Dim oSystemShellExecute As Object oSystemShellExecute = CreateUnoService( _ "com.sun.star.system.SystemShellExecute" ) システムコマンドの実行には ''execute'' メソッドに引数を与えます。 oSystemShellExecute.execute( string aCommand, string aParameter, long nFlags ) -aCommand: 実行するコマンド。 -aParameter: 引数をスペースで区切った文字列で。 -nFlags : フラッグ。デフォルト 0、エラーを無視 1。 &idlref(com.sun.star.system.SystemShellExecuteFlags); SystemShellExecute サービスは OOo からハイパーリンク先をブラウザで開くときなどに利用されています。 |