Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically change the file extension in TSaveDialog.FileName 1

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
In MS Word 2003, when you save a document for the first time a save dialog appears with Doc1.doc as the default filename and notice it includes the default file extension. If you change the "Save as type" combobox to another file extension the "File name" text shows Doc1.new_extension, where new_extension is the chosen file extension.

In Delphi 6, if I call the Execute method of a TSaveDialog control, a save dialog pops up. However, when I change the "Save as type" entry the "File name" text does not change. For example, "File name" contains "Doc1.txt", I change the "Save as type" to "XML Document (*.xml)" and the "File name" still reads "Doc1.txt" instead of "Doc1.xml". Anyone know how to resolve this?

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Steve,

That was exactly what I was looking for - and it works perfectly - thank you very much!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top