VS Code Extensions
VS Office - Lightweight Editor

VS Office - Lightweight Editor

by tetsuji16

Review and make focused edits to DOCX, PPTX and XLSX files in VS Code with conservative OOXML saving.

Downloads

28

Rating

(0)

Version

0.6.3

Last updated

Aug 10, 2026

VS Office - Lightweight Editor for DOCX, PPTX and XLSX

Open and make focused edits to Microsoft Office Open XML files without leaving Visual Studio Code.

VS Office is designed for quick reviews and small corrections in .docx, .pptx, and .xlsx files. Instead of rebuilding the entire document, it changes only the selected OOXML text or cell data and verifies that unrelated package parts remain untouched.

Why VS Office?

  • Stay in your editor: inspect supported Office files directly in Visual Studio Code.
  • Make focused corrections: edit existing Word text runs, PowerPoint text runs, and Excel cells — including formulas.
  • Preserve unrelated content: do not regenerate themes, styles, images, slide masters, embedded files, or other untouched OOXML parts.
  • Validate every save: recheck ZIP CRC values and compare untouched parts with SHA-256 hashes before accepting the result.
  • Recover when needed: create a backup before overwriting by default, and support both standard Save and Save As.

Format support

Format Preview Focused editing
DOCX Page preview powered by docx-preview, plus an editable paragraph outline Existing w:t text runs, re-fanned across runs to preserve bold/italic formatting
PPTX Visual preview of each slide's text plus a per-shape editing card Per-shape text, solid-fill colour, line colour, and shape deletion — themes, masters, animations, and images are left untouched
XLSX Spreadsheet grid of up to 200 rows by 50 columns Any cell, including formulas (edited as =... and rewritten into <f>)

Save protection

VS Office uses a conservative save pipeline:

  1. Apply only the requested text or cell changes to the OOXML package.
  2. Write the result to a temporary file in the same directory.
  3. Validate ZIP integrity and verify every untouched package part with SHA-256.
  4. Create a recoverable copy in .vs-office-backups when backups are enabled.
  5. Replace the original atomically only after validation succeeds.

Digitally signed and encrypted packages open in read-only mode.

Getting started

  1. Install VS Office - Lightweight Editor from the Visual Studio Marketplace.
  2. Open a .docx, .pptx, or .xlsx file in Visual Studio Code.
  3. Review the preview or grid and edit a supported text or cell value.
  4. Press Ctrl+S to save, or use Save As to create a separate file.

Automatic backups are enabled by default. Change vsOffice.createBackupOnSave in Visual Studio Code Settings if required.

Important limitations

VS Office is a lightweight editor, not a replacement rendering engine for Microsoft Word, PowerPoint, or Excel. Browser HTML and Microsoft Office use different text-layout engines, so pixel-perfect preview parity cannot be guaranteed. Editing text can cause normal line wrapping, pagination, or slide reflow when the file is reopened in Microsoft Office.

The extension is designed to preserve unrelated OOXML content and layout data, but final deliverables should always be verified in Microsoft Office.

Development

npm install
npm test

Open this folder in Visual Studio Code and press F5 to start an Extension Development Host.

Open-source components

  • docxjs / docx-preview (Apache-2.0) renders DOCX content as HTML.
  • JSZip (MIT / GPLv3) reads and writes OOXML ZIP containers and validates CRC values.

SheetJS Community Edition was evaluated for XLSX support. It is not used for saving because regenerating an entire workbook can discard unknown features or layout information. PPTXjs-based renderers were also evaluated, but the current PPTX implementation intentionally uses a structural view because those projects could not provide the required fidelity guarantees.

Verifying the webview render

samples/ contains minimal valid DOCX/PPTX/XLSX fixtures plus a headless Chromium renderer used to confirm the webview (preview + edit tabs) draws correctly without a VS Code host:

npm install --no-save playwright
npx playwright install --with-deps chromium
node samples/make-samples.js      # regenerate sample.docx / sample.pptx / sample.xlsx
node samples/render-webview.js    # capture render-*.png for each format

The renderer loads media/viewer.js, media/viewer.css, jszip, and docx-preview directly and posts a model to the same message path the extension uses, so it exercises the real UI code path. (The samples/ folder is excluded from the published .vsix.)

Related extensions