It is possible to show the common dialogs without using a Form to put the ActiveX control in. Here's how:
Code:'In a BAS module Option Explicit Private Sub Main() Const cdlCCFullOpen = 2&, cdlCCHelpButton = 8&, cdlCFApply = &H200&, cdlCFBoth = 3& Const cdlCFEffects = &H100&, cdlCFHelpButton = 4&, cdlHelpContents = 3& Const cdlOFNAllowMultiselect = &H200&, cdlOFNExplorer = &H80000, cdlOFNHelpButton = &H10& Const cdlPDHelpButton = &H800&, cdlPDNoWarning = &H80&, cdlPDPrintSetup = &H40& On Error Resume Next With CreateObject("MSComDlg.CommonDialog") 'Late-bound 'With New CommonDialog 'Referenced comdlg32.ocx (not from Toolbox) .AboutBox .Flags = cdlCCFullOpen Or cdlCCHelpButton .ShowColor .Flags = cdlCFApply Or cdlCFBoth Or cdlCFEffects Or cdlCFHelpButton .ShowFont .HelpCommand = cdlHelpContents .HelpFile = Dir(Environ$("WINDIR") & "\Help\*.hlp") .ShowHelp .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNHelpButton .ShowOpen .ShowSave .Flags = cdlPDHelpButton Or cdlPDNoWarning .ShowPrinter .Flags = .Flags Or cdlPDPrintSetup .ShowPrinter End With End Sub




Reply With Quote
