declare function mygetsavefilename lib "comdlg32.dll " alias "getsavefilenamea " (ofil as ces_openfilename) as integer
type ces_openfilename lstructsize as long hwndowner as long hinstance as long lpstrfilter as string lpstrcustomfilter as string nmaxcustfilter as string nfilterindex as long lpstrfile as string nmaxfile as long lpstrfiletitle as string nmaxfiletitle as long lpstrinitialdir as string lpstrtitle as string flags as long nfileoffset as integer nfileextension as integer lpstrdefext as string lcustdata as long lpfnhook as long lptemplatename as string end type
dim cmdlg_openfilename as ces_openfilename, lngapiresults as long
引用组件microsoft common dialog control 6.0对应文件comdlg32.ocx 然后就很方便了,随时可以调用
发表于:2007-09-01 11:10:174楼 得分:0
拖动组件栏的commondialog到窗体就有一个commondialog1然后放上一个command1如下 private sub command1_click() commondialog1.flags = &h401 commondialog1.showsave msgbox "你选择的文件是: " & commondialog1.filename end sub