0 Members and 1 Guest are viewing this topic.
(defun gps->getfiled (/ str )(setq str "Function GetTargetFileName Set objDialog = CreateObject(\"UserAccounts.CommonDialog\") objDialog.Filter = \"DwgFile(*.dwg)|*.dwg\" objDialog.InitialDir = \".\" If objDialog.ShowOpen <> 0 Then GetTargetFileName = objDialog.FileName End If Set objDialog = NothingEnd Functionret = GetTargetFileName" )(if (not #wscript#)(setq #wscript# (vlax-create-object "ScriptControl")))(vlax-put #wscript# 'language "vbs")(vlax-invoke-method #wscript# 'ExecuteStatement str)(vlax-invoke-method #wscript# 'eval "ret"))(defun Getfile (/ str )(setq str "Function GetTargetFileName Set objDialog = CreateObject(\"UserAccounts.CommonDialog\") objDialog.Filter = \"DwgFile(*.dwg)|*.dwg|Word|.doc|Excel|.xls|All Files|*.*\" objDialog.Flags = 1574404 objDialog.FilterIndex = 2 objDialog.InitialDir = \"C:\" If objDialog.ShowOpen <> 0 Then GetTargetFileName = objDialog.FileName End If Set objDialog = NothingEnd Functionret = GetTargetFileName")(if (not #wscript#)(setq #wscript# (vlax-create-object "ScriptControl")))(vlax-put #wscript# 'language "vbs")(vlax-invoke-method #wscript# 'ExecuteStatement str)(vlax-invoke-method #wscript# 'eval "ret"))
objDialog.DialogTitle="Try it"
Quote from: cjw on April 02, 2009, 08:13:39 AMobjDialog.DialogTitle="Try it"; Error: Automation error. Object does not support this property or method: 'objDialog.DialogTitle'
(if (setq X (VLAX-CREATE-OBJECT "MSComDlg.CommonDialog")) (progn (VLAX-PUT-PROPERTY X "DialogTitle" DialogTitle) (VLAX-PUT-PROPERTY X "Filename" "") (VLAX-PUT-PROPERTY X "Filter" FILTER) (VLAX-PUT-PROPERTY X "MaxFileSize" 10000) (VLAX-PUT-PROPERTY X "Flags" 512) (VLAX-PUT-PROPERTY X "Action" 1) (VLAX-GET-PROPERTY X "Filename") ) )
(setq ddd (vlax-create-object "UserAccounts.CommonDialog"))(vlax-dump-object ddd t);;Result_$ ; ICommonDialog: ICommonDialog Interface; Valeurs de propriétés:; FileName = ""; Filter = ""; FilterIndex = type de résultat non pris en charge: 19; Flags = type de résultat non pris en charge: 19; InitialDir = ""; Owner (RO) = ...Contenu indexé masqué...; Méthodes prises en charge:; ShowOpen ()T _$
_$ (vlax-dump-object (vlax-create-object "UserAccounts.CommonDialog") t); ICommonDialog: ICommonDialog Interface;特性值:; FileName = ""; Filter = ""; FilterIndex = 不支持结果类型: 19; Flags = 不支持结果类型: 19; InitialDir = ""; Owner (RO) = ...不显示带索引的内容...;支持的方法:; ShowOpen ()T
Could select some files,and return full path of the files selected???
HiQuoteCould select some files,and return full path of the files selected???I've try it, but it's do not work Just a question, for select one file, why you dont use getfiled function ?If you want a dll that allows you to select multiple files@+