Hello, Tomaz -
Assign a value to the pathname and filename return values before calling the GetFileSaveName function, as shown in the following code sample:
Constant ULong OFN_CREATEPROMPT = 2^0
Constant ULong OFN_EXPLORER = 2^1
Constant ULong OFN_EXTENSIONDIFFERENT = 2^2
Constant ULong OFN_FILEMUSTEXIST = 2^3
Constant ULong OFN_HIDEREADONLY = 2^4
Constant ULong OFN_LONGNAMES = 2^5
Constant ULong OFN_NOCHANGEDIR = 2^6
Constant ULong OFN_NODEREFERENCELINKS = 2^7
Constant ULong OFN_NOLONGNAMES = 2^8
Constant ULong OFN_NONETWORKBUTTON = 2^9
Constant ULong OFN_NOREADONLYRETURN = 2^10
Constant ULong OFN_NOTESTFILECREATE = 2^11
Constant ULong OFN_NOVALIDATE = 2^12
Constant ULong OFN_OVERWRITEPROMPT = 2^13
Constant ULong OFN_PATHMUSTEXIST = 2^14
Constant ULong OFN_READONLY = 2^15
Integer li_rc
ULong lul_flags
String ls_initdir, ls_pathname, ls_filename
ls_initdir = "C:\MyDocuments"
ls_filename = "DefaultFilename.pdf"
ls_pathname = ls_initdir + "\" + ls_filename
lul_flags = OFN_EXPLORER + OFN_HIDEREADONLY + OFN_LONGNAMES + OFN_OVERWRITEPROMPT
li_rc = GetFileSaveName("Save As PDF",ls_pathname,ls_filename,"pdf", &
"PDF files (*.pdf)",ls_initdir,lul_flags)
MessageBox("Results","RC = "+String(li_rc) + &
"~r~nPathname = "+ls_pathname + &
"~r~nFilename = "+ls_filename)
Please note the path name you supply will NOT be the initial path/folder the user sees when the Save As dialog window opens, and the user will be able to specify a different filename, but the filename you supply will be filled in initially.
Regards, John