ホーム > ゲーム映像CGソフト > 製品一覧 > Softimage > サポート > Softimage FAQ

ゲーム映像CGソフト

Softimage FAQ / スクリプト

ファイルブラウザを使う方法 (VBScript)

VBScript内でファイルブラウザを開く方法を紹介します。以下のコードをインプリメントして下さい。拡張子でフィルタリングすることも可能です。選択したファイルは、dlg.filenameで参照できます。

  • このファイルブラウザはActiveXコントロールを使用していますので、VisualBasicをインストールしておく必要があります。

' Create the dialog object. set dlg = createobject("mscomdlg.commondialog")

' Set the file filter. dlg.filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"

' If you don't do the following, you get an error. dlg.maxfilesize = 128

' Display the File Open dialog. dlg.showopen

if dlg.fileName <> "" Then Logmessage dlg.filename End if

Softimage