CommonDialogControl not returning file extension

GaryDGaryD Member Posts: 66
I'm using the Common Dialog Management codeunit (412) In NAV50 to return a path and filename for a dataport export. In the dialog I want to specify CSV as a default extension but allow the user to also select TXT. However the path returned from the CommonDialogControl does not contain the extension. How can I either return the correct extension from the dialog or at least know which extension the user picked? My call is this:

FileName := CmDlgMgt.OpenFile('Machester 1099 Export','',4,'*.csv|*.csv,*.txt|*.txt',1);

Also, once in the CommonDialogControl, selecting a filetype from the drop down does not seem to apply a filter to the files shown.

Thanks!

Comments

  • garakgarak Member Posts: 3,263
    Hy Gary
    Filename := CommDlgMgmt.OpenFile('DESCRIPTION','',4,'CSV (*.csv)|*.csv|Text (*.txt)|*.txt',0); //0 -> Open, 1 -> Save
    

    Regards from Germany
    Do you make it right, it works too!
  • rajpatelbcarajpatelbca Member Posts: 178
    Just on mistake put pipe symbol instead of comma in file filter
    Experience Makes Man Perfect....
    Rajesh Patel
  • GaryDGaryD Member Posts: 66
    That did it. Thanks for the help!
Sign In or Register to comment.