DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

FileDlgSave

Hello

 

Is there any counterpart command to FileDlgShow? Like FileDlgSave?

 

I have been currently using the following code to allow me better functionality to get file pathways for saving and opening files however the MSComDlg object does not exists on all of my clients machines.  I know I could use the FileDlgShow to find file pathways but I was wondering if there was something similar to get file pathways for saving.

 

I am using 2015 32 but some of my clients are using Diadem 2012.

 

Function filedialog(filt, def, title, save)
    dim dialog, discard
    set dialog = CreateObject("MSComDlg.CommonDialog")
    dialog.MaxFileSize = 256
    if filt = "" then
        dialog.Filter = "All Files (*.*)|*.*"
    else
        dialog.Filter = filt
    end if
    dialog.FilterIndex = 1
    dialog.DialogTitle = title
    dialog.InitDir = CreateObject("WScript.Shell").SpecialFolders("MyDocuments")
    dialog.FileName = ""
    if save = true then
       
        dialog.DefaultExt = def
        dialog.Flags = &H800 + &H4
        discard = dialog.ShowSave()
        'msgbox(dialog.FileName)
    else
        dialog.Flags = &H1000 + &H4 + &H800
        discard = dialog.ShowOpen()
    end if
    filedialog = dialog.FileName
    
end function
Tim
0 Kudos
Message 1 of 3
(3,700 Views)

Hi Tim,

 

You can use the command FileNameGet. The second parameter differentiate between reading and saveing

 

If (FileNameGet("REPORT", "FileWrite", LayoutReadPath & PicFile & ".TDR") = "IDOk") Then ' Dialog closed with Ok
  Call PicSave(FileDlgFileName)
End If

Greetings

Walter

0 Kudos
Message 2 of 3
(3,697 Views)

Excellent Walter Thanks

Tim
0 Kudos
Message 3 of 3
(3,694 Views)