システムコマンドの実行
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 )
SystemShellExecute サービスは OOo からハイパーリンク先をブラウザで開くときなどに利用されています。 |