The File Editor (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/XxLunaxX29/ExploradorDeArchivos/llms.txt
Use this file to discover all available pages before exploring further.
FormEdit) is the built-in document editor of Explorador de Archivos. It opens from the main toolbar and presents two views depending on the file type: a DataGridView for tabular formats (CSV and Excel) and a RichTextBox (rtbContenido) for text-based formats. PDF files are rendered in an embedded Microsoft WebView2 control. The editor tracks the active file path in _currentFile and the detected format in _currentFileType, so the Guardar button always writes back using the same format that was loaded.
Supported Formats
| Format | Extension | View Mode | Editable |
|---|---|---|---|
| CSV | .csv | Grid (DataGridView) | Yes |
| Excel | .xlsx / .xls | Grid (DataGridView) | Yes (.xlsx only) |
| Word | .docx / .doc | Rich Text (RichTextBox) | Yes (.docx only) |
| PowerPoint | .pptx / .ppt | Rich Text (slide text extracted) | Read-only |
| Plain Text | .txt | Rich Text (RichTextBox) | Yes |
| JSON | .json | Rich Text with syntax highlighting | Yes |
| XML | .xml | Rich Text with syntax highlighting | Yes |
.pdf | WebView2 browser render | Read-only |
Opening a File
Click Cargar
The Cargar button (
btnCargar_Click) opens an OpenFileDialog with a multi-format filter that lists every supported extension. The full path is stored in _currentFile.Extension detection
The app reads
Path.GetExtension(_currentFile).ToLower() and branches to the matching private loader method. There is no content sniffing — the extension is authoritative.Loading into the correct view
- CSV (
CargarCSV) — splits the first line on commas to createDataGridViewcolumns, then adds one row per subsequent line. - Excel (
CargarExcel) — opens the.xlsxfile withDocumentFormat.OpenXml.Packaging.SpreadsheetDocument; the firstRowbecomes column headers, remaining rows become data rows. Shared-string-table values are resolved viaGetCellValue. - Word (
CargarWord) — extracts text fromword/document.xmlinside the.docxZIP archive by reading allw:tnodes and concatenating theirInnerText. The result is placed inrtbContenido. - PowerPoint (
CargarPowerPoint) — iteratesppt/slides/slide*.xmlentries in sorted order, extractsa:ttext nodes per slide, and formats them with a--- Diapositiva N ---heading. - TXT (
CargarTexto) — reads the entire file withFile.ReadAllText(UTF-8) intortbContenido. Font is set to Consolas 11 pt on a dark background (RGB(30, 30, 30)). - JSON (
CargarJSON) — reads the file as text and appliesAplicarColoreado_JSONfor syntax highlighting: braces/brackets in amber, strings in green, numbers in blue,true/false/nullin orange. - XML (
CargarXML) — reads the file as text and appliesAplicarColoreado_XML: tags in steel blue, attribute names in light blue, attribute values in brownish orange, comments in green. - PDF (
CargarPDF) — hidesrtbContenido, shows theWebView2control, awaitsEnsureCoreWebView2Async, and navigates to the file using an absolutefile://URI.
Editing
For grid-based formats (CSV and Excel), theDataGridView is configured with AllowUserToAddRows = true, AllowUserToDeleteRows = true, and ReadOnly = false. Users can click any cell to edit in place, press Delete on a selected row to remove it, or use the blank bottom row to append new records.
For text-based formats (TXT, JSON, XML, and Word), rtbContenido is fully writable. The JSON and XML syntax highlighting is applied once on load; it is not re-evaluated while typing. For Word documents, the text is extracted as plain paragraphs — inline formatting such as bold or tables is not preserved in the editor view.
Saving
Clicking Guardar (btnGuardar_Click) dispatches to the format-specific writer:
- CSV (
GuardarCSV) — iteratesDataGridViewcolumns for the header row, then iterates rows; each cell value is double-quoted, with internal quotes escaped as"". The file is overwritten withFile.WriteAllText(UTF-8). - Excel (
GuardarExcel) — copies the original file to a.backupsidecar and a temp file, opens the temp file withSpreadsheetDocument.Open(…, isEditable: true), clears all rows from the activeSheetData, writes the header row and all data rows asCellValues.Stringcells with explicitCellReferenceaddresses (A1,B1, …), saves, then atomically replaces the original. The backup is deleted on success or restored on failure. - Word (
GuardarWord) — copies the original to a.backupand a temp file, opens the temp file as aZipArchive, readsword/document.xml, removes all existingw:tnodes, creates a neww:p→w:r→w:tparagraph for each line inrtbContenido, replaces the ZIP entry, then atomically replaces the original. - TXT / JSON / XML (
GuardarTexto) — callsFile.WriteAllText(_currentFile, rtbContenido.Text, Encoding.UTF8).
PDF editing is not supported. Clicking Guardar while a PDF is loaded displays an informational message and takes no action. PDFs are rendered read-only via the embedded Microsoft WebView2 control.
PowerPoint editing is not supported. Only the plain text content of each slide is extracted for review. Clicking Guardar while a PowerPoint is loaded displays a message directing you to Microsoft PowerPoint for editing.