Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

LMDTextEditDlg set Desired Folder before saving the file

How can a certain folder be set before saving the file?

Tagged:

Comments

  • 1 Comment sorted by Votes Date Added
  • TLMDTextEditDlg component does not attempt to save any file by default. Original editing text can be specified via Lines property or by providing a path to a text file via FileName property. After dialog execution, modified text is accessible via Lines property. 

    If you want to save modified text to a file, you can do this by providing full path to SaveToFile method:

    LMDTextEditDlg1.Lines.SaveToFile('C:\MtFolder\MyFileName.txt');

    If you show dialog's toolbar using teToolbat Options flag, which makes Save toolbar button visible, then there are no direct property to specify the default destination folder. However, you still can do it using OnCustomize event handler like this:

    procedure TForm1.LMDTextEditDlg1Customize(Sender: TObject);
    var
      frm: TLMDFrmTextEditor;
    begin
      frm := LMDTextEditDlg1.Dlg as TLMDFrmTextEditor;
      frm.SaveDialog.InitialDir := 'C:\MyFolder';
    end;
Sign In or Register to comment.