Giter VIP home page Giter VIP logo

ooxml-viewer-vscode's Introduction

OOXML Viewer VSCode Extension

Continuous Integration Visual Studio Marketplace Open in Remote - Containers

* Please note, files must be stored locally, i.e. not in OneNote, Dropbox, etc.

Features

Display the contents of OOXML documents in VS Code

To view the contents of an OOXML document, right click on the file in the context menu, then click on the part you want to view.

Opening an OOXML Part

Edit the contents of OOXML documents in VS Code

To edit an OOXML part, select the part in the OOXML Viewer menu then edit and save. The changes will be reflected in the OOXML document.

Editing the contents of an OOXML document in VS Code

Get diff when OOXML documents are edited from outside, e.g. in Microsoft Word, Libre Office Writer, Microsoft Excel, Libre Office Calc, etc.

When a document opened by the OOXML Viewer is edited from an external program, changed parts are marked with a yellow asterisk, deleted parts are marked with a red asterisk, and new parts are marked with a green asterisk.

To view a diff with the previous version of an OOXML part, right click on the part in the OOXML Viewer menu and click "Compare with Previous".

Diff adding text to a odt file

Getting the diff of an OOXML Part

Diff adding a slide to a pptx file

Getting the diff of an OOXML Part

Diff removing a slide from a pptx file

Getting the diff of an OOXML Part

Search all parts

To search all parts, right click on the OOXML package in the tree view, select "Search Parts", enter your search term, and press enter/return. The initial search is not case sensitive or whole words only, but once the OOXML Viewer opens the search pane, all VS Code search options are available.

Searching all OOXML Parts

Search parts of any file that uses the Open Packaging Conventions

By default, the OOXML Viewer can view and edit the contents of files with these extensions: ".docx", ".xlsx", ".pptx", ".odt", ".ods", ".odp", ".docm", ".dotm", ".xlsm", ".pptm", ".dotx", ".xltx", ".xltm", ".potx", ".sldx", ".ppsx". But the OOXML Viewer extension can be used with any file type that uses the Open Packaging Conventions or any zip based file type.

To add additional file types, open the settings.json and add or update the files.associations and add an associate with "ooxml". For example, to add "*.vsix" files, settings.json should include

"files.associations": {
  "*.vsix": "ooxml"
}

After adding the file extension, restart VS Code and right click on the file to open and select "Open OOXML File" to view and edit it's contents.

Extension Settings

This extension contributes the following variables to the settings:

  • ooxmlViewer.preserveComments: Boolean, determines if comments will be preserved in XML or removed on save. Defaults to true.
  • ooxmlViewer.maximumOoxmlFileSizeBytes: Number, the maximum size of an ooxml package that the ooxml viewer will be allowed to open. Defaults to 50,000,000.
  • ooxmlViewer.maximumNumberOfOoxmlParts: Number, the maximum number of parts the ooxml viewer will be allowed to open. Defaults to 1,000.
  • ooxmlViewer.maximumXmlPartsFileSizeBytes: Number, the maximum size of an xml file in bytes that the ooxml viewer will try to format. Defaults to 1,000,000.

Release Notes

Please see the Changelog

ooxml-viewer-vscode's People

Contributors

dependabot[bot] avatar mikeebowen avatar yuenm18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ooxml-viewer-vscode's Issues

Compare with previous no longer works with pptx

Hi and thank you for building and maintaining this plugin. It is very useful <3

I have been using the "Compare With Previous" to see what changes in xml files when I make changes to a PowerPoint presentation. This stopped working completely in recent times. Meaning that I no longer see diffs in the file (no yellow asterisk, etc.). Perhaps it has something to do with #28

System details:
OS X version: Big Sur 11.6.6
VS Code version: 1.69.2
extension version: v1.2.2

vscode-ooxml-viewer-1.mov

Sorry for the low-res video, I had to compress it.

Let me know if I can provide any other info to help debug. And thanks again.

Rename images in media folder

I'm interested in editing the embedded images for a document. However, I can't see any way to insert or rename image files. even something simple like renaming "image1.svg" to "image001.svg" doesn't seem to work. What am I missing? Or is file editing of embedded content not supported?
I can browse to the image files using explorer, however, it doesn't appear that OOXML ever reloads data from the media folder?

Screenshot 2024-05-30 142524

One week experience report

Hello, it's me again. I have been experiencing this plugin for several days. This plugin is really great and has greatly improved my learning efficiency.Thank u very much!๐Ÿ˜Š
Then feedback a small problem: XML file formatting.When encountered with "/ >"The ending single-line label is mistakenly formatted into two lines and incorrectly indented.The current solution is to work with this plugin.
But my ability is limited, so maybe you can perfect it in the next version.๐Ÿ˜Š

Error to open docx file with command

When open a docx file with vscode command, I got a message Command 'Open OOXML Package' resulted in an error(command 'ooxmlViewer.openOoxmlPackage' not found)

Editing xml in document.xml that have shapes or 3D Models

To reproduce this, create a docx file with a shape or 3D Model, then save it and open the parts with OOXML-Viewer and make any change to document.xml, even just adding or removing some text and save the part. Result: the file is corrupted and Word will not open it.

Scanning progress bar is not closed

The Viewer sometimes doesn't close the progress bar after scanning. Maybe some error occurred, but the result is good, and I keep work. It is just a little noise.๐Ÿ™‚ Only VS Code re-openning helps.

Code_zP6jFTHeTV

For example, today it happened with this file: close-bar-error.pptx

Not sure is it relevant, but I collected some logs that VS Code provides:

[2022-01-21 11:42:28.239] [exthost] [info] Extension host with pid 17780 started
[2022-01-21 11:42:28.239] [exthost] [info] Skipping acquiring lock for c:\Users\thead\AppData\Roaming\Code\User\workspaceStorage\13cb7a9017e7b13098adc60ac4b9c66a.
[2022-01-21 11:42:28.518] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
[2022-01-21 11:42:28.538] [exthost] [info] ExtensionService#_doActivateExtension vscode.html-language-features, startup: false, activationEvent: 'onLanguage:html'
[2022-01-21 11:42:28.560] [exthost] [info] ExtensionService#_doActivateExtension yuenm18.ooxml-viewer, startup: false, activationEvent: 'onView:ooxmlViewer'
[2022-01-21 11:42:28.669] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'
[2022-01-21 11:42:28.679] [exthost] [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.github
[2022-01-21 11:42:28.688] [exthost] [info] ExtensionService#_doActivateExtension donjayamanne.githistory, startup: true, activationEvent: '*'
[2022-01-21 11:42:28.842] [exthost] [info] ExtensionService#_doActivateExtension redhat.vscode-yaml, startup: true, activationEvent: '*', root cause: fbaligand.vscode-logstash-editor
[2022-01-21 11:42:29.115] [exthost] [info] ExtensionService#_doActivateExtension mhutchie.git-graph, startup: true, activationEvent: '*'
[2022-01-21 11:42:29.615] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: 'api', root cause: donjayamanne.githistory
[2022-01-21 11:42:29.741] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
[2022-01-21 11:42:29.751] [exthost] [info] ExtensionService#_doActivateExtension fbaligand.vscode-logstash-editor, startup: true, activationEvent: '*'
[2022-01-21 11:42:30.479] [exthost] [info] Eager extensions activated
[2022-01-21 11:42:30.493] [exthost] [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
[2022-01-21 11:42:30.527] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
[2022-01-21 11:42:30.544] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 11:42:30.556] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 11:42:30.560] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 11:42:30.572] [exthost] [info] ExtensionService#_doActivateExtension alefragnani.Bookmarks, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 11:42:30.609] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 11:42:31.949] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing, startup: false, activationEvent: 'onLanguage:markdown'
[2022-01-21 11:42:31.964] [exthost] [info] ExtensionService#_doActivateExtension vscode.markdown-language-features, startup: false, activationEvent: 'onLanguage:markdown'
[2022-01-21 11:42:32.260] [exthost] [info] ExtensionService#_doActivateExtension vscode.markdown-math, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 11:42:32.272] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-checkbox, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 11:42:32.291] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-emoji, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 11:42:32.315] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-mermaid, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 11:42:32.334] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-preview-github-styles, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 11:42:32.349] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-yaml-preamble, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 11:42:32.664] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-01-21 11:42:32.675] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-01-21 11:42:32.704] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-01-21 15:29:44.955] [exthost] [info] ExtensionService#_doActivateExtension redhat.vscode-xml, startup: false, activationEvent: 'onLanguage:xml'
[2022-01-21 15:29:48.050] [exthost] [warning] [redhat.vscode-xml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[xml]', provide the URI of a resource or 'null' for any resource.
[2022-01-21 15:42:48.305] [exthost] [error] [redhat.vscode-xml] provider FAILED
[2022-01-21 15:42:48.307] [exthost] [error] Canceled: Canceled
	at S.makeCancelError (c:\Users\thead\.vscode\extensions\redhat.vscode-xml-0.18.2\dist\extension.js:2:362236)
	at S.handleFailedRequest (c:\Users\thead\.vscode\extensions\redhat.vscode-xml-0.18.2\dist\extension.js:2:362087)
	at c:\Users\thead\.vscode\extensions\redhat.vscode-xml-0.18.2\dist\extension.js:2:326960
	at async s.provideDocumentSymbols (c:\Users\thead\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:87704)
[2022-01-21 21:56:24.504] [exthost] [info] extension host terminating: renderer closed the socket
[2022-01-21 21:56:24.596] [exthost] [info] Extension host with pid 17780 exiting with code 0
[2022-01-21 21:56:26.824] [exthost] [info] Extension host with pid 15336 started
[2022-01-21 21:56:26.824] [exthost] [info] Skipping acquiring lock for c:\Users\thead\AppData\Roaming\Code\User\workspaceStorage\0bfe12cb68c80a72ddf819aae4eaf799.
[2022-01-21 21:56:27.319] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
[2022-01-21 21:56:27.338] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing, startup: false, activationEvent: 'onLanguage:markdown'
[2022-01-21 21:56:27.352] [exthost] [info] ExtensionService#_doActivateExtension vscode.markdown-language-features, startup: false, activationEvent: 'onLanguage:markdown'
[2022-01-21 21:56:27.383] [exthost] [info] ExtensionService#_doActivateExtension yuenm18.ooxml-viewer, startup: false, activationEvent: 'onView:ooxmlViewer'
[2022-01-21 21:56:27.510] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'
[2022-01-21 21:56:27.521] [exthost] [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.github
[2022-01-21 21:56:27.535] [exthost] [info] ExtensionService#_doActivateExtension donjayamanne.githistory, startup: true, activationEvent: '*'
[2022-01-21 21:56:27.682] [exthost] [info] ExtensionService#_doActivateExtension redhat.vscode-yaml, startup: true, activationEvent: '*', root cause: fbaligand.vscode-logstash-editor
[2022-01-21 21:56:27.895] [exthost] [info] ExtensionService#_doActivateExtension mhutchie.git-graph, startup: true, activationEvent: '*'
[2022-01-21 21:56:29.010] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: 'api', root cause: donjayamanne.githistory
[2022-01-21 21:56:29.086] [exthost] [info] ExtensionService#_doActivateExtension vscode.markdown-math, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 21:56:29.277] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-checkbox, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 21:56:29.370] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-emoji, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 21:56:29.436] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-mermaid, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 21:56:29.457] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-preview-github-styles, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 21:56:29.472] [exthost] [info] ExtensionService#_doActivateExtension bierner.markdown-yaml-preamble, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
[2022-01-21 21:56:29.594] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
[2022-01-21 21:56:29.606] [exthost] [info] ExtensionService#_doActivateExtension fbaligand.vscode-logstash-editor, startup: true, activationEvent: '*'
[2022-01-21 21:56:30.171] [exthost] [info] Eager extensions activated
[2022-01-21 21:56:30.240] [exthost] [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
[2022-01-21 21:56:30.272] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
[2022-01-21 21:56:30.292] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 21:56:30.305] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 21:56:30.312] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 21:56:30.326] [exthost] [info] ExtensionService#_doActivateExtension alefragnani.Bookmarks, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 21:56:30.479] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
[2022-01-21 21:56:32.993] [exthost] [info] ExtensionService#_doActivateExtension redhat.vscode-xml, startup: false, activationEvent: 'onLanguage:xml'
[2022-01-21 21:56:34.289] [exthost] [warning] [redhat.vscode-xml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[xml]', provide the URI of a resource or 'null' for any resource.

VS Code info
Version: 1.63.2 (user setup)
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:40:02.816Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19044

Plug-in functionality has gone missing

Unless I'm doing something wrong, the plug-in is dead on my Mac.
macOS 12.3.1 (21E258) / MacBook Pro (16-inch, 2021)
VS Code 1.72.0
OOXML Viewer v1.3.0

I started using this plug-in a few months ago to inspect docx files. I just right clicked to explore the package contents and that easily got me to the file I needed.

Today a coworker was trying to use it and pointed out that there's nothing in the context menu (she's on a Windows box). I tried it on my Mac and got the same result -- nothing.

Open OOXML Package in New Tab

Not sure, but it could be related to issue #13.

It would be great to be able to work with multiple documents in separate tabs within the same Visual Studio Code window. For example, when a user right-clicks, there should be an additional option of "Open OOXML Package in New Tab."

Currently, as a workaround, I have to place the files in different folders and open a new Visual Studio Code window for the second file.

Comments not preserved in XML parts

I'm using version 1.2.2 on Windows 10. When I edit a part of an OOXML package and add a comment liek the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<calcChain xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <!-- <c r="C1" i="1" l="1"/> -->
  <c r="C1" i="1" l="1"/>
</calcChain>

Upon save (Ctrl-S in VS Code), the part is saved but the commented line disappears.

Is it possible to preserve the comment?

Trouble installing the extension

Thanks for making this! I tried to install in VS Code, and I don't seem to be able to get it to work.

When I install, I get a menu in the left sidebar called "OOXML Viewer" but I don't see the menu for "OOXML Editor" that I see in your gif demo.

Here's what I see: Screen Shot 2020-10-10 at 4 51 49 PM

Is there something else I need to do to make this work? Would love to be able to use this!

Thank you!

Plugin stopped working on VS Code 1.78

The plugin no longer works since VSCode 1.78. Clicking on "Open OOXML Package" doesn't do anything.
Downgrading VS Code to 1.77.3 makes it work again.
Please help.

Analyzing multiple document

When i try to see multiple word document's document.xml file in order to compare these files and detect differences between .xml tags, plugin isn't allow to me. It's working like a toggle button. When i try to analyze another word document .xml files at the same time, old document's .xml files is closed by plugin. So, is there any way to visualize different two or more .xml file at the same time?

Changes Disappear on Excel

On Windows it appears that Excel touches the file twice on save and triggers FileSystemWatcher.onDidChange twice, which causes the compare with previous functionality to flash on and then disappear on the second event, because then the files are the same, which breaks the Compare with Previous functionality for Excel.

ChineseCharProblems

Hi, thanks a lot for your work!
I have mat a problem when processing Chinese document, parsing and display are working fine, but after saving the edit, all Chinese char including font name will saved as some unknown char.
image
Is this some bug of the plugins or am I missing some necessary lib, or something wrong with my settings. I'm using macOs.
Thanks again.

Parsing XML doesn't work properly

Hello, I recently started to learn Office Open XML, I installed this plugin in VS Code, but there seem to be some problems when I use it.

  1. When I right-click on a document and select 'View Contents', no load notification appears, but the' OOXML Viewer 'window still correctly displays the uncompressed file directory, but when I click on the'.xml 'file, it appears unsaved, even though it has been formatted in the edit area.
  2. I tried to modify and save the document in Office, and after switching to VS Code, I did not see the load notice, nor did the asterisk of file modification appear in the "OOXML Viewer" window.

environment:win10_1803+vscode_1.52.1+Microsoftoffice365/WPSoffice
My English is not well, so you can watch my video demo.If I have improper operation, please tell me, thank you!

XML formatting issue

The extension formats XML a little bit incorrectly:

TEST.PPTX
image

Actual result

<a:gridCol w="4064000">
    <a:extLst>
        <a:ext uri="{9D8B030D-6E8A-4147-A177-3AD203B41FA5}">
            <a16:colId
                xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" val="3978500163"/>
            </a:ext>
        </a:extLst>
    </a:gridCol>

Expected result

<a:gridCol w="4064000">
    <a:extLst>
        <a:ext uri="{9D8B030D-6E8A-4147-A177-3AD203B41FA5}">
            <a16:colId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" val="3978500163"/>
        </a:ext>
    </a:extLst>
</a:gridCol>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.