Posted 20 March 2018, 6:59 pm EST
hi
When I’m using c1Editor and I saved the rtf-document how can I get the filename of this document by code?
best regards
Peter
Forums Home / ComponentOne / WinForms Edition
Posted by: gessi on 20 March 2018, 6:59 pm EST
Posted 20 March 2018, 6:59 pm EST
hi
When I’m using c1Editor and I saved the rtf-document how can I get the filename of this document by code?
best regards
Peter
Posted 21 March 2018, 4:57 pm EST
Hello Peter,
As per our understanding, you wish to display the name of the rtf file just saved from the C1Editor. For this, you can use the below mentioned code snippet:
string pattern = "*.rtf";
var dirInfo = new DirectoryInfo("../../");
var file = (from f in dirInfo.GetFiles(pattern) orderby f.LastWriteTime descending select f).First();
MessageBox.Show(file.Name);
A sample using the same has been attached for your reference.
If this does not satisfy your requirement, kindly elaborate on it a bit further so that we assist you accordingly.
Best Regards,
Esha