'This sample project uses the Microsoft Common Dialog OCX File - comdlg32.ocx ' 'Project code by Tim Markoski tmarkoski© machinist-toolbox.com Sub Main() ' xx Default Error Handler On Error Resume Next Dim objMenu ' xx Establish Menu Structure objMenu = Array("&File") SetMenu "Titlebar", objMenu objMenu = Array("&Open File||OPEN", "&Save File||SAVE", "-", "Print||Print", "&Color||COLOR","-","E&xit||Exit") SetMenu "&File", objMenu Output.Caption = "Common Dialog Example - NS Basic/Desktop Demo" If TypeName(dlgcommon)<>"ICommonDialog" Then MsgBox "Common Dialog Control (comdlg32.ocx) not installed. TypeName(dlgCommon)=" & TypeName(dlgCommon) End If End Sub Sub OPEN_Click() Dim strTitleOpen Dim strFilters Dim strAppTitle ' xx Title for Open Dialogue strTitleOpen = "Common Dialogue File Open - NS Basic/Desktop Demo" ' xx Title for Message Box strAppTitle = "NS Basic/Desktop Demo" ' xx Common Dialogue File Extensions strFilters = "NS Basic/Palm Files [*.prj]|*.prj|NS Basic/CE Files [*.nsb]|*.nsb|NS Basic/Desktop Files [*.nsd]|*.nsd|Executable Files [*.exe]|*.exe|Dynamic-Link Libray Files [*.dll]|*.dll|ASCII Text Files [*.txt]|*.txt|All Files (*.*)|*.*" dlgCommon.DialogTitle = strTitleOpen dlgCommon.Filter = strFilters dlgCommon.ShowOpen If Not dlgCommon.FileName = vbnullstring Then MsgBox dlgCommon.FileName, vbokonly, strAppTitle End If End Sub Sub SAVE_Click() Dim strTitleSave Dim strFilters Dim strAppTitle ' xx Title for Open Dialogue strTitleSave = "Common Dialogue File Save - NS Basic/Desktop Demo" ' xx Title for Message Box strAppTitle = "NS Basic/Desktop Demo" ' xx Common Dialogue File Extensions strFilters = "NS Basic/Palm Files [*.prj]|*.prj|NS Basic/CE Files [*.nsb]|*.nsb|NS Basic/Desktop Files [*.nsd]|*.nsd|Executable Files [*.exe]|*.exe|Dynamic-Link Libray Files [*.dll]|*.dll|ASCII Text Files [*.txt]|*.txt|All Files (*.*)|*.*" dlgCommon.DialogTitle = strTitleSave dlgCommon.Filter = strFilters dlgCommon.ShowSave If Not dlgCommon.FileName = vbnullstring Then MsgBox dlgCommon.FileName, vbokonly, strAppTitle End If End Sub Sub PRINT_Click() dlgCommon.ShowPrinter End Sub Sub COLOR_Click() dlgCommon.ShowColor Print "Color selected = " , dlgCommon.color End Sub Sub EXIT_Click() Bye End Sub